PyQGIS – What Is the Algorithm Name for Count Points in Polygon Using PyQGIS

algorithmpyqgisqgis-processing

I want to count points in polygon, using PyQGIS. When I check the documentation, I find the description of the {parameter_dictionary}, but not the algorithm name which must also be provided.

What is the name of the algorithm which I have to write in here processing.run("algorithm_id", {parameter_dictionary})?

Best Answer

In case you do not know a name or id, you can use:

searchstring = 'count' # to get all algorithms just leave this empty
for alg in QgsApplication.processingRegistry().algorithms():
    if searchstring in alg.id(): 
        print(alg.id())

to search for it. In your case its native:countpointsinpolygon

Related Question