Opened 4 years ago
Last modified 3 years ago
#4896 new enhancement
Allow ST_Boundary() to return start/end point of closed LineString
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | postgis | Version: | |
Keywords: | Cc: |
Description
At the moment ST_Boundary() returns an EMPTY geometry when called against closed linestrings. This makes sense from a topological point of view, but in some cases you may want to get an official startpoint and it's currently annoyingly hard to get that, especially for multilines.
I think we do support some kind of BoundaryNodeRule for other operations, and then I guess it would be nice to have for ST_Boundary as well.
What do you think DrJTS ?
Change History (8)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
I believe ST_StartPoint should be allowed to run on any geometry instead.
follow-up: 4 comment:3 by , 4 years ago
What would your ST_StartPoint return against a MULTILINESTRING((0 0, 20 0, 10 5, 0 0),(100 0, 120 0))
?
An ST_Boundary() with BoundaryNodeRule 2 would return MULTIPOINT((0 0), (100 0), (120 0))
.
Note how BOTH start and end points are returned for the second geometry…
comment:4 by , 4 years ago
Replying to strk:
What would your ST_StartPoint return against a
MULTILINESTRING((0 0, 20 0, 10 5, 0 0),(100 0, 120 0))
?
Perhaps ST_StartPoint
could be extended to support MultiLineStrings
as input (returning a MultiPoint
containing the start points of each element)?
comment:5 by , 4 years ago
This is the one of the reasons that the BoundaryNodeRule concept was introduced in JTS: it's handy to be able to use it to get the node point of closed LineStrings. (And it also allows getting the endpoints of degree 1 in a MultiLineString, rather than being hostage to the less-useful Mod-2 rule of the standard.
So +1 for adding BoundaryNodeRule support to ST_Boundary
, especially since it is already provided for ST_Relate
.
comment:6 by , 3 years ago
Owner: | changed from | to
---|
comment:7 by , 3 years ago
Owner: | changed from | to
---|
comment:8 by , 3 years ago
Milestone: | PostGIS 3.2.0 → PostGIS Fund Me |
---|
The BoundaryNodeRule is supported by ST_Relate: https://postgis.net/docs/ST_Relate.html