File tree 1 file changed +22
-0
lines changed
python/plugins/sextante/ftools
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,28 @@ def processAlgorithm(self, progress):
184
184
if not FEATURE_EXCEPT :
185
185
SextanteLog .addToLog (SextanteLog .LOG_WARNING , "Feature exception while computing convex hull" )
186
186
187
+ def simpleMeasure (self , inGeom ):
188
+ measure = QgsDistanceArea ()
189
+ attr1 = measure .measure (inGeom )
190
+ if inGeom .type () == QGis .Polygon :
191
+ attr2 = self .perimMeasure ( inGeom , measure )
192
+ else :
193
+ attr2 = attr1
194
+ return ( attr1 , attr2 )
195
+
196
+ def perimMeasure (self , inGeom , measure ):
197
+ value = 0.00
198
+ if inGeom .isMultipart ():
199
+ poly = inGeom .asMultiPolygon ()
200
+ for k in poly :
201
+ for j in k :
202
+ value = value + measure .measureLine ( j )
203
+ else :
204
+ poly = inGeom .asPolygon ()
205
+ for k in poly :
206
+ value = value + measure .measureLine ( k )
207
+ return value
208
+
187
209
def defineCharacteristics (self ):
188
210
self .name = "Convex hull"
189
211
self .group = "Geoprocessing tools"
You can’t perform that action at this time.
0 commit comments