Skip to content
Permalink
Browse files
also add MultiPolygon support in Densify geometry
  • Loading branch information
alexbruy committed May 12, 2012
1 parent 033d58d commit 2607535b3f2dd8438f2e0ee0c17d2fb8f4faf1f5
Showing with 13 additions and 5 deletions.
  1. +13 −5 python/plugins/fTools/tools/doSimplify.py
@@ -196,11 +196,19 @@ def densify( polyline, pointsNumber ):
def densifyGeometry( geometry, pointsNumber, isPolygon ):
output = []
if isPolygon:
rings = geometry.asPolygon()
for ring in rings:
ring = densify( ring, pointsNumber )
output.append( ring )
return QgsGeometry.fromPolygon( output )
if geometry.isMultipart():
polygons = geometry.asMultiPolygon()
for poly in polygons:
p = []
for ring in poly:
p.append( densify( ring, pointsNumber ) )
output.append( p )
return QgsGeometry.fromMultiPolygon( output )
else:
rings = geometry.asPolygon()
for ring in rings:
output.append( densify( ring, pointsNumber ) )
return QgsGeometry.fromPolygon( output )
else:
if geometry.isMultipart():
lines = geometry.asMultiPolyline()

0 comments on commit 2607535

Please sign in to comment.