Skip to content

Commit 700441e

Browse files
committedOct 18, 2016
[processing] remove debug line and fix spatial index creation
1 parent 63955e6 commit 700441e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎python/plugins/processing/gui/AlgorithmDialog.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,11 @@ def checkExtentCRS(self):
127127
unmatchingCRS = True
128128
if isinstance(param, ParameterExtent):
129129
value = self.mainWidget.valueItems[param.name].leText.text().strip()
130-
print value
131130
if value:
132131
hasExtent = True
133132

134133
return hasExtent and unmatchingCRS
135134

136-
137135
def accept(self):
138136
self.settings.setValue("/Processing/dialogBase", self.saveGeometry())
139137

‎python/plugins/processing/tools/vector.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ def testForUniqueness(fieldList1, fieldList2):
221221
def spatialindex(layer):
222222
"""Creates a spatial index for the passed vector layer.
223223
"""
224-
idx = QgsSpatialIndex(features(layer))
224+
request = QgsFeatureRequest()
225+
request.setSubsetOfAttributes([])
226+
if ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED) \
227+
and layer.selectedFeatureCount() > 0:
228+
idx = layer.selectedFeaturesIterator(request)
Code has comments. Press enter to view.
229+
else:
230+
idx = QgsSpatialIndex(layer.getFeatures(request))
225231
return idx
226232

227233

0 commit comments

Comments
 (0)
Please sign in to comment.