mirror of
https://github.com/qgis/QGIS.git
synced 2025-06-19 00:02:48 -04:00
Use a set for classes in PointsInPolygonUnique (faster)
This commit is contained in:
parent
596b56c441
commit
a10936f06a
@ -90,7 +90,7 @@ class PointsInPolygonUnique(GeoAlgorithm):
|
||||
|
||||
attrs = ftPoly.attributes()
|
||||
|
||||
classes = []
|
||||
classes = set()
|
||||
points = spatialIndex.intersects(geom.boundingBox())
|
||||
if len(points) > 0:
|
||||
request = QgsFeatureRequest().setFilterFids(points)
|
||||
@ -101,7 +101,7 @@ class PointsInPolygonUnique(GeoAlgorithm):
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user