AW: [Qgis-developer] Create Multiple Polygons from Polygon and Polylines

Hugentobler Marco marco.hugentobler at karto.baug.ethz.ch
Wed Sep 9 12:16:53 EDT 2009


Hi Matthew

For the polylines that cut the polygon, you could use 
QgsVectorLayer::splitFeatures (or on feature/geometry level 
QgsGeometry::splitGeometry
And for the features that are contained in the polygons, there is 
QgsVectorLayer::addRing.

Hope it helps,
Marco


-----Ursprüngliche Nachricht-----
Von: qgis-developer-bounces at lists.osgeo.org im Auftrag von Matthew Denno
Gesendet: Mi 09.09.2009 16:53
An: qgis-developer
Betreff: [Qgis-developer] Create Multiple Polygons from Polygon and Polylines
 
Hi All,

I am trying to programmaticly create a polygon shapefile from two separate
input shapefiles.  The first is a boundary polygon shapefile and the second
is a a polyline shapefile that contains a number of segments (could many)
that are spatially contained in the boundary polygon.  The polyline segments
either form closed areas or when connected end-to-end extend accross the
polygon. I want to use the polylines to essentially cut the polygon into
smaller polygons.  Does anyone have any suggestions where to start with this
problem.  My question may not be completely clear so I have uploaded an
example picture: http://www.flickr.com/photos/42311742@N02/3904105994/

Thanks,

Matt



-- 
Dr. Marco Hugentobler
HUGIS - GIS programming and consulting
Honrainweg 5
CH-8038 Zürich
marco at hugis.net
http://homepage.hispeed.ch/hugis/




More information about the Qgis-developer mailing list