3

I expected to get 'false' from the following statement:

SELECT ST_IsValid(ST_GeomFromText('POLYGON((0 0,10 0,10 10,10 10,0 10,0 0))'));

Instead it returns true! Even if the vertex in 10,10 is followed by another one with the same coordinates. Maybe I misunderstood something and/or I am making some mistake. Where can I find a complete explain of that makes a geometry not valid?

0

1 Answer 1

6

The canonical definition of geometry validity is the OGC Simple Feature Access for SQL standard.

There is also the PostGIS documentation, although it is more descriptive than formal.

In short, repeated points are valid. This is defined implicitly in the above references. It certainly wouldn't hurt to make it explicit in the PostGIS doc.

3
  • Thank You, It was very helpful! Commented Sep 9, 2019 at 11:39
  • @dr_jts I know its an old question, but do you remember where in the ogc documentation its stated repeated vertices are valid? even if its implicitly. Commented Jan 19, 2021 at 16:34
  • The reference that I use is the OGC SFS 1.1. Sections 2.1.5 and 2.1.6 describe Curves and LineStrings. There is no explicit mention of repeated points, but my understanding is that they are allowed implicitly. This makes sense, because the specification is a topological definition, and repeated points do not affect topology.
    – dr_jts
    Commented Jan 19, 2021 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.