Skip to content
Permalink
Browse files
add MultiLineString support to Densify geometries tool (addresses #5577)
  • Loading branch information
alexbruy committed May 12, 2012
1 parent 6678c75 commit 033d58d454dd8c638f1e79981cec6944ef7824c0
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 033d58d

Please sign in to comment.