Skip to content
Permalink
Browse files
Merge pull request #140 from slarosa/master
Add Multigeometries support in Simplify tool
  • Loading branch information
alexbruy committed May 13, 2012
2 parents edaaddd + e9ff072 commit 346991e287d530c39a164f7449d12f60a7ac74c6
Showing with 10 additions and 2 deletions.
  1. +10 −2 python/plugins/fTools/tools/doSimplify.py
@@ -162,10 +162,18 @@ def restoreGui( self ):
def geomVertexCount( geometry ):
geomType = geometry.type()
if geomType == 1: # line
points = geometry.asPolyline()
if geometry.isMultipart():
pointsList = geometry.asMultiPolyline()
points=sum(pointsList, [])
else:
points = geometry.asPolyline()
return len( points )
elif geomType == 2: # polygon
polylines = geometry.asPolygon()
if geometry.isMultipart():
polylinesList = geometry.asMultiPolygon()
polylines=sum(polylinesList, [])
else:
polylines = geometry.asPolygon()
points = []
for l in polylines:
points.extend( l )

0 comments on commit 346991e

Please sign in to comment.