[Shapelib] Handling polygon rings in shapefiles

Frank Warmerdam warmerdam at pobox.com
Tue Oct 11 08:12:15 PDT 2005


On 10/10/05, Brian Peschel <brianp at occinc.com> wrote:
> But if I have multiple outer rings and multiple inner rings and the
> order doesn't matter, how do I figure out which inner ring goes with
> which outer ring?  Do I need to determine containment?
>
> What if I have an outer ring containing and outer ring containing an
> inner ring?  How do I know which outer ring the inner ring is for?  The
> spec tells me a ring can not intersect, but it doesn't say anything that
> an outer ring can not contain an outer ring.
>
> Any insight into this would be extremely helpful.  Any pointers on using
> the shapelib library to help with this will also be helpful.  Thanks in
> advance.

Brian,

As far as I recall Shapelib does not address the issue of associating
inner rings with their owning outer ring.  There is code to accomplish
this in OGR in the shape2ogr.cpp module which might be of some
use to you.

  http://www.gdal.org/srctree/ogr/ogrsf_frmts/shape/shape2ogr.cpp

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Shapelib mailing list