Luiz,<br><br>Thanks for your thoughts.  I agree with your approach for the most part.  I think that the difficulty for me will be with the implementation and achieving it programmaticlly.<br><br>I should have been more specific about the picture that I shared.  When I say segment I am referring to each individual single straight section (i.e. two points) so each of the polylines that you are referring to is actually many individual segments.  That doesn&#39;t really change the approach but adds an extra step.  Basically the polylines need to be &quot;dissolved&quot; first.  Is there an existing function to acheive this?  Also, is there an enexisting function to union polygons programaticlly?<br>
<br>Matt<br><br><br><br><div class="gmail_quote">On Mon, Sep 14, 2009 at 6:38 PM, Luiz Motta <span dir="ltr">&lt;<a href="mailto:motta.luiz@gmail.com">motta.luiz@gmail.com</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;">
Matt,<br>
<br>
I see your picture and my idea are same operations:<br>
<br>
1) Split:<br>
Create polygons from layer polygon(source) with polylines(cut).<br>
Polygon data -&gt; Boundary Shapefile<br>
Cut data  -&gt; Polylines segment (only two segments in picture showed) * these lines cross or touch line boundary of polygon<br>
Result -&gt; three Polygons<br>
<br>
2) Make polygon from polyline closed:<br>
Polyline -&gt; Polylines segment (only closed)<br>
Result -&gt; Polygon<br>
<br>
3) Union:<br>
Polygon -&gt; polygon from result first item<br>
Polygon -&gt; polygon from result second  item<br>
Result -&gt; All polygon<br>
<br>
Strategy:<br>
1) Separate type polylines: Closed (A) and not Closed(B)<br>
2) Make polygon from A<br>
3) Split polygon(big polygon) with B<br>
4) Union result item 2 with result item 3.<br>
<br>
<br>
<br>
Matthew Denno escreveu:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Hi All,<br>
<br>
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: <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></div></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
  <br>
</div></blockquote>
<br>
</blockquote></div><br>