[processing] use bulk features loading to speedup spatial index creation

This commit is contained in:
Alexander Bruy 2016-06-21 15:30:55 +03:00
parent 5a4397189c
commit 2d9b2a354b

View File

@ -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