[QGIS Commit] r13032 - trunk/qgis/python/plugins/fTools/tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Mar 8 18:59:41 EST 2010


Author: cfarmer
Date: 2010-03-08 18:59:40 -0500 (Mon, 08 Mar 2010)
New Revision: 13032

Modified:
   trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py
Log:
Fixes bug which only computed the convex hull of features within the current extent (i.e. entire extent of layer is now used: as expected). Fixes #2507.

Modified: trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py
===================================================================
--- trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py	2010-03-08 23:43:55 UTC (rev 13031)
+++ trunk/qgis/python/plugins/fTools/tools/doGeoprocessing.py	2010-03-08 23:59:40 UTC (rev 13032)
@@ -408,6 +408,7 @@
     FEATURE_EXCEPT = True
     vproviderA = self.vlayerA.dataProvider()
     allAttrsA = vproviderA.attributeIndexes()
+    vproviderA.select(allAttrsA)
     fields = vproviderA.fields()
     writer = QgsVectorFileWriter( self.myName, self.myEncoding, 
     fields, QGis.WKBPolygon, vproviderA.crs() )
@@ -416,6 +417,7 @@
     inGeom = QgsGeometry()
     outGeom = QgsGeometry()
     nElement = 0
+    
     # there is selection in input layer
     if self.mySelectionA:
       nFeat = self.vlayerA.selectedFeatureCount()
@@ -473,6 +475,7 @@
           GEOS_EXCEPT = False
     # there is no selection in input layer
     else:
+      rect = self.vlayerA.extent()
       nFeat = vproviderA.featureCount()
       if useField:
         unique = ftools_utils.getUniqueValues( vproviderA, self.myParam )
@@ -483,7 +486,7 @@
           hull = []
           first = True
           outID = 0
-          vproviderA.select( allAttrsA )
+          vproviderA.select( allAttrsA )#, rect )
           vproviderA.rewind()
           while vproviderA.nextFeature( inFeat ):
             atMap = inFeat.attributeMap()
@@ -515,6 +518,7 @@
         self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
         hull = []
         vproviderA.rewind()
+        vproviderA.select(allAttrsA)
         while vproviderA.nextFeature( inFeat ):
           inGeom = QgsGeometry( inFeat.geometry() )
           points = ftools_utils.extractPoints( inGeom )



More information about the QGIS-commit mailing list