Skip to content
Permalink
Browse files
also add MultiPolygon support in Densify geometry
  • Loading branch information
alexbruy authored and jef-n committed May 17, 2012
1 parent 99f88b3 commit 32cd9b55db1b74cb16bf68f532518fe6a9637756
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 32cd9b5

Please sign in to comment.