[geos-devel] "self intersecting" polys

Martin Davis mbdavis at VividSolutions.com
Thu Sep 2 18:54:37 EDT 2004


JTS and GEOS support the OGC Simple Features geometry model.  According
to this model, the shape you provided must be represented as a polygon
with a hole (rather than a polygon with a self-intersecting shell as in
your data).

There is an alternative spatial model which allows shells which
intersect in single points; however, in that model holes must be
disjoint from the shell.

To avoid complete insanity an API really has to pick which model it
supports.  I've mulled over the possibility of allowing the user to
choose which model he wants to use - technically this is only of medium
difficulty (although a fair bit of code changes and major amounts of
testing). Also, it's not clear whether this would simply drive users
crazy trying to sort out which model is being used. To allow both models
to be supported at the same time would be harder, but still possible, I
suppose.

However, I think that deviating from the OGC model (which is now the ISO
model) is pretty dangerous, since it will introduce the possibilities of
incompatibilities with other systems.  For better or worse, the
standards community has spoken.  This is a good thing which benefits us
all, but it comes with the responsibility of making the effort to follow
the standards.

Unfortunately I can't think of an easy way to convert self-intersecting
polygons to valid JTS/GEOS polygons using the current API.  This might
be a useful function to have in the future, however.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: Chris G. Nicholas [mailto:cgn at globexplorer.com] 
> Sent: September 2, 2004 3:37 PM
> To: geos-devel at geos.refractions.net
> Subject: [geos-devel] "self intersecting" polys
> 
> 
> How difficult would it be for GEOS to support so-called "self 
> intersecting" polygons - i.e. those with a common vertex. 
> Must we explode this sort of thing into a huge number of 
> overlapping polygons?
> 
> thanks!
> 
> Chris Nicholas
> GlobeXplorer
> 
> 
> 



More information about the geos-devel mailing list