mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] use bulk features loading to speedup spatial index creation
This commit is contained in:
parent
5a4397189c
commit
2d9b2a354b
@ -199,10 +199,7 @@ def testForUniqueness(fieldList1, fieldList2):
|
||||
def spatialindex(layer):
|
||||
"""Creates a spatial index for the passed vector layer.
|
||||
"""
|
||||
idx = QgsSpatialIndex()
|
||||
feats = features(layer)
|
||||
for ft in feats:
|
||||
idx.insertFeature(ft)
|
||||
idx = QgsSpatialIndex(layer.getFeatures())
|
||||
return idx
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user