[postgis-users] Polygon validity

Andrea Peri 2007 aperi2007 at gmail.com
Wed Mar 31 11:25:35 PDT 2010


In the 6.1.5 paragraph of 06-103r3 is reported:

For MultiPoints:

>..
>A MultiPoint is simple if no two Points in the MultiPoint are equal (have identical coordinate values in X and Y).
>Every MultiPoint is spatially equal under the definition in Clause 6.1.15.3 to a simple Multipoint.
>..


For curves:

>..
>A Curve is simple if it does not pass through the same Point twice with the possible exception of the two end
>points (Reference [1], section 3.12.7.3):
>∀ c ∈ Curve, [a, b] = c.Domain, c =: f :[a, b] → ℜ n
>c.IsSimple ⇔ ∀ x1, x2 ∈ [a, b]: [ f(x1)=f(x2) ∧ x1<x2] ⇒ [x1=a ∧ x2=b]
>..

So a curve with 2 consecutive point like this
linestring (10 10, 20 20, 20 20, 30 30) is violating this definition

But even this line is invalid for this definition:

linestring (10 10, 20 20, 30 30, 40 40, 50 50, 30 30, 60 60)
(where the repeated points are not consecutive).

because the definition reporting in document:
∀ x1, x2 ∈ [a, b]: [ f(x1)=f(x2) ∧ x1<x2] ⇒ [x1=a ∧ x2=b]

Is saying that having the same location f(x1) is acceptable only for the starting and ending point of the curve.
every other point (not only consecutive) are not allowed to have f(x1) = f(x2) (same location).



>Kevin Neufeld wrote:
>This is often something that is easily misunderstood.  So, to be clear, according to the OGC specs, simplicity really 
>*only* applies to point and linear features ([multi]point, [multi]linestrings).  Validity on the other hand *only* 
>applies to areal features ([multi]polygons).  I put together some thoughts [1] a while back on this.
>
>The OGC specs aren't totally clear regarding duplicate points in linestrings, just that "has no anomalous geometric 
>points, such as self intersection or self tangency" and "is simple if it does not pass through the same point twice". 
>The developers at the time decided that this does not include duplicate points.  I suppose one could argue either way, 
>but to me this really does include duplicate points.
>
>PostGIS also somewhat subscribes to the SQL/MM specifications.  In there I read "is not simple if any interior point has 
>the same location as another interior point or a point on the boundary".  To me, this is more clear and, Rykov, I think 
>you're right, ST_IsSimple really should not allow duplicate points.  I'll put in a ticket.
>
>So, simplicity is for lines and points.
>A *polygon* is *valid* iff all the underlying linear features are *simple* (like no figure 8's in the boundary) and also 
>follows several other rules (like the inner rings being contained within the exterior ring, etc).




More information about the postgis-users mailing list