[postgis-users] Intersection errors

strk at refractions.net strk at refractions.net
Wed Jun 8 02:46:17 PDT 2005


On Tue, Jun 07, 2005 at 02:05:05PM -0600, Ethan Alpert wrote:
> 
> 
> While we're on the topic of multipolygons. I've noticed that the
> shapefile specification doesn't have any convention for communicating
> outer and inner rings. That said how do apps like shp2pgsql and ogr2ogr
> determine whether the next polygon in a list is an inner or a new outer?
> I understand that the convention is that inner rings are counter
> clockwise. But still how is the direction of the ring determined
> efficiently?

There's an area computation algorithms that accidentally return
direction of rings (sign of result gives it).
After having found outer and inner rings the shp2pgsql tries
to couple each hole with a shell.

--strk;

> 
> 
> 
> -e
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> Markus Schaber
> Sent: Tuesday, June 07, 2005 2:02 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Intersection errors
> 
> 
> Hi, Sean,
> 
> Sean M. Montague schrieb:
> > I've been working on it, and I now realize the problem...not sure if 
> > it will solve my intersect problem, but I'll get to that later.  There
> 
> > is a logical reason for dissolving some of layers, such as lakes at 
> > certain scales.  If they are multi polys, there is a significant size 
> > savings when writing out as SVG.  I just need to see if I can 
> > distinguish between a hole, and say another lake.  Examining what you 
> > suggested looks like a good start.  Thanks.
> 
> Yes, it is easily possible. Maybe you should take a look at the Well
> Known Text format specification from the OpenGIS consortium (Part of
> their "Simple features for SQL" specification, or use the PostGIS source
> or some other program that correctly exports WKT to find out how it
> works.
> 
> The basic idea for Multipolygon is:
> 
> MULTIPOLYGON(((First polygon outer ring),(1st poly first hole),(1st poly
> 2nd hole)),((2nd Poly outer ring)(2nd Poly hole)),((3rd Poly with no
> hole)),((4th Poly outer ring)(4th poly 1st hole)(4th poly 2nd hole)))
> 
> All holes (inner rings) have to be completely inside their outer ring,
> and may not overlap each other. A polygon may be contained completely
> inside the hole of another polygon (like an island), but they may not
> overlap.
> 
> For the exact rules how the inner and outer rings may touch and
> intersect, please see geometry model part of the aforementioned
> specification.
> 
> HTH,
> Markus
> 
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list