Skip to content
Permalink
Browse files

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.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13032 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer
cfarmer committed Mar 8, 2010
1 parent 59a24b8 commit cd1f0aa3bc9a247c676a18b2e9e33ea0a098bd2f
Showing with 5 additions and 1 deletion.
  1. +5 −1 python/plugins/fTools/tools/doGeoprocessing.py
@@ -408,6 +408,7 @@ def convex_hull(self, useField ):
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 @@ def convex_hull(self, useField ):
inGeom = QgsGeometry()
outGeom = QgsGeometry()
nElement = 0

# there is selection in input layer
if self.mySelectionA:
nFeat = self.vlayerA.selectedFeatureCount()
@@ -473,6 +475,7 @@ def convex_hull(self, useField ):
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 @@ def convex_hull(self, useField ):
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 @@ def convex_hull(self, useField ):
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 )

0 comments on commit cd1f0aa

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