[postgis-devel] isvalid() error

strk at refractions.net strk at refractions.net
Fri Jan 14 01:04:18 PST 2005


On Fri, Jan 14, 2005 at 08:55:06AM -0000, Mark Cave-Ayland wrote:
> 
> > -----Original Message-----
> > From: postgis-devel-bounces at postgis.refractions.net 
> > [mailto:postgis-devel-bounces at postgis.refractions.net] On 
> > Behalf Of strk at refractions.net
> > Sent: 14 January 2005 07:23
> > To: PostGIS Development Discussion
> > Subject: Re: [postgis-devel] isvalid() error
> > 
> > 
> > PostGIS always allowed polygon rings with 3 points.
> > In this case it disagrees with GEOS about this.
> > Also, PostGIS does not allow 0 points.
> > 
> > Should we enforce GEOS constraints or just have isvalid
> > return FALSE in these cases ?
> > 
> > --strk;
> 
> 
> Hi strk,
> 
> Well I can see mention of validity in the OGC spec (see page 20), but I
> can't find anything that says invalid geometries should not be accepted? I
> also know that we have some polygons here consisting of a single ring with 3
> points - does this mean that they cannot be used with any of the GEOS
> functions?

In moving to LWGEOM I tried to reflect previous HWGEOM behaviour.
For this purpose I added yesterday a check for "closed" rings
which was missing. The parser was already checking for minpoints
(1 for points, 2 for lines, 3 for polygons). 

GEOS (and thus JTS) is more picky because it has handles
concepts of Interior/Boundary/Exterior. Probably a polygon
with NO Interior will be a problem for inner algorithms.

So, short answer is: yes, you canot use those polys with GEOS.

Question is: can we safely have GEOS accept them ?

I belive both SnapToGrid() and Simplify() also produce 3points rings ...


--strk;

> 
> 
> Kind regards,
> 
> Mark. 
> 
> ------------------------
> WebBased Ltd
> South West Technology Centre
> Tamar Science Park
> Plymouth
> PL6 8BT 
> 
> T: +44 (0)1752 791021
> F: +44 (0)1752 791023
> W: http://www.webbased.co.uk
> 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel

-- 

For standing up against patentability of software,

  Thank You, Poland!

Read the intervention:    http://kwiki.ffii.org/ConsPolon041221En
Send your thanks:         thankyoupoland.info
Read/do more:		  http://www.noepatents.org/



More information about the postgis-devel mailing list