diff --git a/python/plugins/processing/tools/vector.py b/python/plugins/processing/tools/vector.py index 16564e6932e..2d2ac206729 100644 --- a/python/plugins/processing/tools/vector.py +++ b/python/plugins/processing/tools/vector.py @@ -225,7 +225,7 @@ def spatialindex(layer): request.setSubsetOfAttributes([]) if ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED) \ and layer.selectedFeatureCount() > 0: - idx = layer.selectedFeaturesIterator(request) + idx = QgsSpatialIndex(layer.selectedFeaturesIterator(request)) else: idx = QgsSpatialIndex(layer.getFeatures(request)) return idx