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

Matthew Denno mgdenno at gmail.com
Wed Sep 9 12:31:15 EDT 2009


Hi Marco,

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.

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.

Thanks again for your input.

Matt

On Wed, Sep 9, 2009 at 12:16 PM, Hugentobler Marco <
marco.hugentobler at karto.baug.ethz.ch> wrote:

> 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/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090909/5263d91b/attachment.html


More information about the Qgis-developer mailing list