Opened 8 years ago

Last modified 3 years ago

#3425 new enhancement

Clarify PostGIS handling of repeated points wrt validity in docs

Reported by: dbaston Owned by:
Priority: low Milestone: PostGIS Fund Me
Component: documentation Version: master
Keywords: Cc:

Description

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)

comment:1 by robe, 8 years ago

Milestone: PostGIS 2.3.0PostGIS 2.4.0

comment:2 by robe, 7 years ago

Milestone: PostGIS 2.4.0PostGIS 2.5.0

comment:3 by robe, 7 years ago

Component: postgisdocumentation
Owner: changed from pramsey to robe

comment:4 by robe, 6 years ago

Milestone: PostGIS 2.5.0PostGIS 3.0.0

comment:5 by robe, 5 years ago

Owner: changed from robe to dbaston

Did the behavior change again in 3.0?

comment:6 by dbaston, 5 years ago

Milestone: PostGIS 3.0.0PostGIS 3.1.0
Owner: dbaston removed

comment:7 by pramsey, 3 years ago

Milestone: PostGIS 3.1.0PostGIS Fund Me
Note: See TracTickets for help on using tickets.