Skip to content
Permalink
Browse files

[processing] remove debug line and fix spatial index creation

  • Loading branch information
alexbruy committed Oct 18, 2016
1 parent 63955e6 commit 700441eec9836b225fc0b577dda9c895c86d22cc
Showing with 7 additions and 3 deletions.
  1. +0 −2 python/plugins/processing/gui/AlgorithmDialog.py
  2. +7 −1 python/plugins/processing/tools/vector.py
@@ -127,13 +127,11 @@ def checkExtentCRS(self):
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())

@@ -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)

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


0 comments on commit 700441e

Please sign in to comment.
You can’t perform that action at this time.