I am trying to use the processing toolbox to perform a spatial query (points in polygon). I am not sure how to use the tool and I keep getting Error: Wrong number of parameters.
Here is my script:
polygon_path = r"D:\PythonTesting\SelectByLocation\mitte.shp"
points_path = r"D:\PythonTesting\SelectByLocation\punkte.shp"
polygon = QgsVectorLayer(polygon_path, 'Mitte', 'ogr')
points = QgsVectorLayer(points_path, 'Berlin Punkte', 'ogr')
processing.runalg('qgis:selectbylocation', points, polygon, False, False, False, 0)
I used the documentation, which indicates that I have to use 6 parameters.
However, if I call alghelp the following is returned, indicating 5 parameters:
ALGORITHM: Select by location
INPUT
INTERSECT
PREDICATE
METHOD
OUTPUT
METHOD(Aktuelle Auswahl ändern mit)
0 - creating new selection
1 - adding to current selection
2 - removing from current selection
Either way I am not getting it to run correctly.
No comments:
Post a Comment