Skip to content

Commit

Permalink
[processing] use bulk features loading to speedup spatial index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jun 21, 2016
1 parent 5a43971 commit 2d9b2a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/plugins/processing/tools/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 2d9b2a3

Please sign in to comment.