Skip to content

Commit

Permalink
[processing] remove debug line and fix spatial index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Oct 18, 2016
1 parent 63955e6 commit 700441e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions python/plugins/processing/gui/AlgorithmDialog.py
Expand Up @@ -127,13 +127,11 @@ def checkExtentCRS(self):
unmatchingCRS = True unmatchingCRS = True
if isinstance(param, ParameterExtent): if isinstance(param, ParameterExtent):
value = self.mainWidget.valueItems[param.name].leText.text().strip() value = self.mainWidget.valueItems[param.name].leText.text().strip()
print value
if value: if value:
hasExtent = True hasExtent = True


return hasExtent and unmatchingCRS return hasExtent and unmatchingCRS



def accept(self): def accept(self):
self.settings.setValue("/Processing/dialogBase", self.saveGeometry()) self.settings.setValue("/Processing/dialogBase", self.saveGeometry())


Expand Down
8 changes: 7 additions & 1 deletion python/plugins/processing/tools/vector.py
Expand Up @@ -221,7 +221,13 @@ def testForUniqueness(fieldList1, fieldList2):
def spatialindex(layer): def spatialindex(layer):
"""Creates a spatial index for the passed vector 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)

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Oct 18, 2016

Collaborator

@alexbruy shouldn't this be idx = QgsSpatialIndex( layer.selectedFeaturesIterator(request) )?

This comment has been minimized.

Copy link
@alexbruy

alexbruy Oct 19, 2016

Author Contributor

Oops, my bad. Fixed now

else:
idx = QgsSpatialIndex(layer.getFeatures(request))
return idx return idx




Expand Down

0 comments on commit 700441e

Please sign in to comment.