[postgis-users] Self-intersecting polygon gives ST_IsSimple=true

Sandro Santilli strk at kbt.io
Wed May 10 04:44:47 PDT 2017


On Mon, May 08, 2017 at 03:48:01PM +0300, Jukka Rahkonen wrote:
> 
> Ok, it was defined in JTS 1.13 http://javadox.com/com.vividsolutions/jts/1.13/com/vividsolutions/jts/geom/Geometry.html#isSimple()
> 
> "Valid polygonal geometries are simple, since their rings must not
> self-intersect. isSimple tests for this condition and reports false if it is
> not met. (This is a looser test than checking for validity)."
> 
> And now in JTS 1.15 it is
> 
> "Polygonal geometries are simple by definition, so isSimple trivially
> returns true. (Note: this means that isSimple cannot be used to test for
> (invalid) self-intersections in Polygons. In order to check if a Polygonal
> geometry has self-intersections, use Geometry.isValid())."
> 
> I believe that there is some good reason for this change but doesn't it put
> too much responsibility for the user to know not to test polygons with
> IsSimple? Why does it accept polygon as input at all?

This is a good question, I'm adding Martin Davis to the recipients
list in case he has pointers to rationale for both the change and
the acceptance (JTS does have an IllegalArgumentException too..)

--strk;


More information about the postgis-users mailing list