Skip to content

Commit

Permalink
Fixes bug which only computed the convex hull of features within the …
Browse files Browse the repository at this point in the history
…current extent (i.e. entire extent of layer is now used: as expected). Fixes #2507.

git-svn-id: http://svn.osgeo.org/qgis/trunk@13032 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Mar 8, 2010
1 parent f60dda6 commit 1f1d648
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -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() )
Expand All @@ -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()
Expand Down Expand Up @@ -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 )
Expand All @@ -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()
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 1f1d648

Please sign in to comment.