Skip to content
Browse files
fix for sextante/convexhull tool based on field
the tool does not work if option "Create convex hulls based on field" is used
to due of missing some methods. This patch fixes the issue.
  • Loading branch information
slarosa committed Dec 14, 2012
1 parent 32f0dfd commit 7e34355
Showing 1 changed file with 22 additions and 0 deletions.
@@ -184,6 +184,28 @@ def processAlgorithm(self, progress):
SextanteLog.addToLog(SextanteLog.LOG_WARNING, "Feature exception while computing convex hull")

def simpleMeasure(self, inGeom ):
measure = QgsDistanceArea()
attr1 = measure.measure(inGeom)
if inGeom.type() == QGis.Polygon:
attr2 = self.perimMeasure( inGeom, measure )
attr2 = attr1
return ( attr1, attr2 )

def perimMeasure(self, inGeom, measure ):
value = 0.00
if inGeom.isMultipart():
poly = inGeom.asMultiPolygon()
for k in poly:
for j in k:
value = value + measure.measureLine( j )
poly = inGeom.asPolygon()
for k in poly:
value = value + measure.measureLine( k )
return value

def defineCharacteristics(self): = "Convex hull" = "Geoprocessing tools"

0 comments on commit 7e34355

Please sign in to comment.