We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bcdecd commit 641c09bCopy full SHA for 641c09b
python/plugins/processing/tools/vector.py
@@ -200,7 +200,13 @@ def testForUniqueness(fieldList1, fieldList2):
200
def spatialindex(layer):
201
"""Creates a spatial index for the passed vector layer.
202
"""
203
- idx = QgsSpatialIndex(features(layer))
+ request = QgsFeatureRequest()
204
+ request.setSubsetOfAttributes([])
205
+ if ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED) \
206
+ and layer.selectedFeatureCount() > 0:
207
+ idx = layer.selectedFeaturesIterator(request)
208
+ else:
209
+ idx = QgsSpatialIndex(layer.getFeatures(request))
210
return idx
211
212
0 commit comments