Skip to content
Permalink
Browse files

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

  • Loading branch information
alexbruy committed Jun 21, 2016
1 parent 5a43971 commit 2d9b2a354b01e29b8fe39aea02829d892880b438
Showing with 1 addition and 4 deletions.
  1. +1 −4 python/plugins/processing/tools/vector.py
@@ -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


0 comments on commit 2d9b2a3

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