Skip to content

Commit

Permalink
Use a set for classes in PointsInPolygonUnique (faster)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 13, 2015
1 parent 596b56c commit a10936f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
Expand Up @@ -90,7 +90,7 @@ def processAlgorithm(self, progress):

attrs = ftPoly.attributes()

classes = []
classes = set()
points = spatialIndex.intersects(geom.boundingBox())
if len(points) > 0:
request = QgsFeatureRequest().setFilterFids(points)
Expand All @@ -101,7 +101,7 @@ def processAlgorithm(self, progress):
if engine.contains(tmpGeom.geometry()):
clazz = ftPoint.attributes()[classFieldIndex]
if clazz not in classes:
classes.append(clazz)
classes.add(clazz)

outFeat.setGeometry(geom)
if idxCount == len(attrs):
Expand Down

0 comments on commit a10936f

Please sign in to comment.