Skip to content
Permalink
Browse files
add MultiLineString support to Densify geometries tool (addresses #5577)
  • Loading branch information
alexbruy authored and jef-n committed May 17, 2012
1 parent 3b0d3db commit 99f88b312fb8f11a45469df11a40552428642c32
Showing with 10 additions and 4 deletions.
  1. +10 −4 python/plugins/fTools/tools/doSimplify.py
@@ -194,17 +194,23 @@ def densify( polyline, pointsNumber ):
return output

def densifyGeometry( geometry, pointsNumber, isPolygon ):
output = []
if isPolygon:
rings = geometry.asPolygon()
output = []
for ring in rings:
ring = densify( ring, pointsNumber )
output.append( ring )
return QgsGeometry.fromPolygon( output )
else:
points = geometry.asPolyline()
output = densify( points, pointsNumber )
return QgsGeometry.fromPolyline( output )
if geometry.isMultipart():
lines = geometry.asMultiPolyline()
for points in lines:
output.append( densify( points, pointsNumber ) )
return QgsGeometry.fromMultiPolyline( output )
else:
points = geometry.asPolyline()
output = densify( points, pointsNumber )
return QgsGeometry.fromPolyline( output )

class GeomThread( QThread ):
def __init__( self, function, inputLayer, useSelection, tolerance, writeShape, shapePath, shapeEncoding ):

0 comments on commit 99f88b3

Please sign in to comment.