Clarify PostGIS handling of repeated points wrt validity in docs
PostGIS considers polygons to be valid if they have consecutive repeated points within a ring. I came across an interpretation of the OGC spec in which this is not considered valid (https://github.com/elastic/elasticsearch/issues/12644#issuecomment-155888645).
Setting aside the question of whether there is any practical value in considering these polygons invalid, the interpretation goes like this:
- a LineString is a Curve that uses a linear interpolation between points (6.1.6.1)
- a Curve is simple if it does not pass through the same point twice, with the possible exception of the two endpoints (6.1.6.1)
- a Curve that is simple and closed is a Ring (6.1.6.1)
- the boundary of a Polygon consists of a set of LinearRings that make up its exterior and interior boundaries (6.1.11.1b)
It seems that by this reasoning, if you've got consecutive repeated points, you're not a simple curve, and if you're not a simple curve, you're not a LinearRing, and so you're not a part of a valid polygon. A counterargument to this is described here:
https://lists.osgeo.org/pipermail/postgis-users/2010-March/026265.html
Given that there is some confusion or disagreement on this, it seems worthwhile for the PostGIS docs (Sec. 4.3.5) to clarify that these polygons are indeed considered valid in PostGIS.
Change History
(7)
Milestone: |
PostGIS 2.3.0 → PostGIS 2.4.0
|
Milestone: |
PostGIS 2.4.0 → PostGIS 2.5.0
|
Component: |
postgis → documentation
|
Owner: |
changed from pramsey to robe
|
Milestone: |
PostGIS 2.5.0 → PostGIS 3.0.0
|
Owner: |
changed from robe to dbaston
|
Milestone: |
PostGIS 3.0.0 → PostGIS 3.1.0
|
Owner: |
dbaston removed
|
Milestone: |
PostGIS 3.1.0 → PostGIS Fund Me
|
Did the behavior change again in 3.0?