Skip to content

Commit 1f1d648

Browse files
author
cfarmer
committed
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@13032 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f60dda6 commit 1f1d648

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/plugins/fTools/tools/doGeoprocessing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ def convex_hull(self, useField ):
408408
FEATURE_EXCEPT = True
409409
vproviderA = self.vlayerA.dataProvider()
410410
allAttrsA = vproviderA.attributeIndexes()
411+
vproviderA.select(allAttrsA)
411412
fields = vproviderA.fields()
412413
writer = QgsVectorFileWriter( self.myName, self.myEncoding,
413414
fields, QGis.WKBPolygon, vproviderA.crs() )
@@ -416,6 +417,7 @@ def convex_hull(self, useField ):
416417
inGeom = QgsGeometry()
417418
outGeom = QgsGeometry()
418419
nElement = 0
420+
419421
# there is selection in input layer
420422
if self.mySelectionA:
421423
nFeat = self.vlayerA.selectedFeatureCount()
@@ -473,6 +475,7 @@ def convex_hull(self, useField ):
473475
GEOS_EXCEPT = False
474476
# there is no selection in input layer
475477
else:
478+
rect = self.vlayerA.extent()
476479
nFeat = vproviderA.featureCount()
477480
if useField:
478481
unique = ftools_utils.getUniqueValues( vproviderA, self.myParam )
@@ -483,7 +486,7 @@ def convex_hull(self, useField ):
483486
hull = []
484487
first = True
485488
outID = 0
486-
vproviderA.select( allAttrsA )
489+
vproviderA.select( allAttrsA )#, rect )
487490
vproviderA.rewind()
488491
while vproviderA.nextFeature( inFeat ):
489492
atMap = inFeat.attributeMap()
@@ -515,6 +518,7 @@ def convex_hull(self, useField ):
515518
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
516519
hull = []
517520
vproviderA.rewind()
521+
vproviderA.select(allAttrsA)
518522
while vproviderA.nextFeature( inFeat ):
519523
inGeom = QgsGeometry( inFeat.geometry() )
520524
points = ftools_utils.extractPoints( inGeom )

0 commit comments

Comments
 (0)