[processing] remove debug line and fix spatial index creation

This commit is contained in:
Alexander Bruy 2016-10-18 16:54:16 +03:00
parent 63955e6574
commit 700441eec9
2 changed files with 7 additions and 3 deletions

View File

@ -127,13 +127,11 @@ class AlgorithmDialog(AlgorithmDialogBase):
unmatchingCRS = True
if isinstance(param, ParameterExtent):
value = self.mainWidget.valueItems[param.name].leText.text().strip()
print value
if value:
hasExtent = True
return hasExtent and unmatchingCRS
def accept(self):
self.settings.setValue("/Processing/dialogBase", self.saveGeometry())

View File

@ -221,7 +221,13 @@ def testForUniqueness(fieldList1, fieldList2):
def spatialindex(layer):
"""Creates a spatial index for the passed vector layer.
"""
idx = QgsSpatialIndex(features(layer))
request = QgsFeatureRequest()
request.setSubsetOfAttributes([])
if ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED) \
and layer.selectedFeatureCount() > 0:
idx = layer.selectedFeaturesIterator(request)
else:
idx = QgsSpatialIndex(layer.getFeatures(request))
return idx