Skip to content
Permalink
Browse files

reactivate select by location progress bar. Fixes #2517; Thanks to al…

…exbruy for the patch!

git-svn-id: http://svn.osgeo.org/qgis/trunk@13024 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Mar 8, 2010
1 parent 0e72bcb commit c902101fea31908e1688c350556004e44b0f5f0f
Showing with 7 additions and 2 deletions.
  1. +7 −2 python/plugins/fTools/tools/doSelectByLocation.py
@@ -62,20 +62,25 @@ def compute(self, inPoly, inPts, modify):
selectedSet = []
selectProvider.nextFeature(feat)
geomLayer = QgsGeometry(feat.geometry())

self.progressBar.setMaximum( inputProvider.featureCount() + selectProvider.featureCount() )

while selectProvider.nextFeature(feat):
geomLayer = geomLayer.combine(QgsGeometry(feat.geometry()))
self.progressBar.setValue( self.progressBarValue() + 1 )
while inputProvider.nextFeature(feat):
geom = QgsGeometry(feat.geometry())
if geom.intersects(geomLayer):
selectedSet.append(feat.id())
self.progressBar.setValue( self.progressBarValue() + 1 )
if modify == self.tr("adding to current selection"):
selectedSet = list(set(inputLayer.selectedFeaturesIds()).union(selectedSet))
elif modify == self.tr("removing from current selection"):
selectedSet = list(set(inputLayer.selectedFeaturesIds()).difference(selectedSet))
inputLayer.setSelectedFeatures(selectedSet)

#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()

0 comments on commit c902101

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