Boost logo

Geometry :

Subject: [ggl] is_simple is_valid
From: Barend Gehrels (Barend.Gehrels)
Date: 2009-10-03 05:24:34


I'm looking at self-intersections to implement the function is_simple
(based on blocks we already have). But I'm what confused about the name.

According to OGC: IsSimple (): Integer Returns 1 (TRUE) if this
geometric object has no anomalous geometric points, such as self
intersection or self tangency. The description of each instantiable
geometric class will include the specific conditions that cause an
instance of that class to be classified as not simple.

JTS says: Valid polygonal geometries are simple by definition, so
isSimple trivially returns true.

The PostGIS implementation give TRUE back to all self-intersecting
polygons that I try. The function isvalid returns false for
self-intersecting polygons.

SQL Server throws for issimple at self-intersections:
System.ArgumentException: 24144: This operation cannot be completed
because the instance is not valid. Use MakeValid to convert the instance
to a valid instance. Note that MakeValid may cause the points of a
geometry instance to shift slightly.
   at Microsoft.SqlServer.Types.SqlGeometry.ThrowIfInvalid()
   at Microsoft.SqlServer.Types.SqlGeometry.STIsSimple()
So it is often called isvalid (or is_valid). But I cannot find that in
OGC specs (looked a.o. in 06-103r3 (still candidate?))

So I probably overlook something somewhere...

Regards, Barend

Geometry list run by mateusz at