Skip to content
Permalink
Browse files

Use a set for classes in PointsInPolygonUnique (faster)

  • Loading branch information
nyalldawson committed Nov 13, 2015
1 parent 596b56c commit a10936f06ade295a8d35e5e660a8972b634bd12d
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/processing/algs/qgis/PointsInPolygonUnique.py
@@ -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)
@@ -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):

0 comments on commit a10936f

Please sign in to comment.
You can’t perform that action at this time.