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
(cherry picked from commit 2d9b2a3)
  • Loading branch information
alexbruy committed Jun 21, 2016
1 parent 672c229 commit 55fc3ee
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 @@ -201,10 +201,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 55fc3ee

Please sign in to comment.