Hi Marco,<br><br>Thanks for your thoughts.  I will have a look at your suggestions.  It looks like they are definitely the direction that I need to go.<br><br>I anticipate I will have some difficulty because, due to the way the line segments are generated, each polyline segment is a separate feature and they are in no particular order.  It looks like maybe the first step I will have to do is create a number of continuous polylines from the segments, then use the methods you (and Carson in an email that missed the list) suggested.  Does that sound correct?  At that point I could determine whether I should use splitFeatures or addRing.<br>
<br>Thanks again for your input.<br><br>Matt<br><br><div class="gmail_quote">On Wed, Sep 9, 2009 at 12:16 PM, Hugentobler  Marco <span dir="ltr">&lt;<a href="mailto:marco.hugentobler@karto.baug.ethz.ch">marco.hugentobler@karto.baug.ethz.ch</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Matthew<br>
<br>
For the polylines that cut the polygon, you could use<br>
QgsVectorLayer::splitFeatures (or on feature/geometry level<br>
QgsGeometry::splitGeometry<br>
And for the features that are contained in the polygons, there is<br>
QgsVectorLayer::addRing.<br>
<br>
Hope it helps,<br>
Marco<br>
<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: <a href="mailto:qgis-developer-bounces@lists.osgeo.org">qgis-developer-bounces@lists.osgeo.org</a> im Auftrag von Matthew Denno<br>
Gesendet: Mi 09.09.2009 16:53<br>
An: qgis-developer<br>
Betreff: [Qgis-developer] Create Multiple Polygons from Polygon and Polylines<br>
<div><div></div><div class="h5"><br>
Hi All,<br>
<br>
I am trying to programmaticly create a polygon shapefile from two separate<br>
input shapefiles.  The first is a boundary polygon shapefile and the second<br>
is a a polyline shapefile that contains a number of segments (could many)<br>
that are spatially contained in the boundary polygon.  The polyline segments<br>
either form closed areas or when connected end-to-end extend accross the<br>
polygon. I want to use the polylines to essentially cut the polygon into<br>
smaller polygons.  Does anyone have any suggestions where to start with this<br>
problem.  My question may not be completely clear so I have uploaded an<br>
example picture: <a href="http://www.flickr.com/photos/42311742@N02/3904105994/" target="_blank">http://www.flickr.com/photos/42311742@N02/3904105994/</a><br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Dr. Marco Hugentobler<br>
HUGIS - GIS programming and consulting<br>
Honrainweg 5<br>
CH-8038 Zürich<br>
<a href="mailto:marco@hugis.net">marco@hugis.net</a><br>
<a href="http://homepage.hispeed.ch/hugis/" target="_blank">http://homepage.hispeed.ch/hugis/</a><br>
<br>
<br>
</font></blockquote></div><br>