Opened 3 years ago

Closed 3 years ago

#4981 closed enhancement (fixed)

ST_StartPoint support any geometry

Reported by: kalenik Owned by: robe
Priority: medium Milestone: PostGIS 3.2.0
Component: postgis Version: master
Keywords: Cc:

Description

ST_StartPoint can be enhanced to pick start point from any geometry. Will be useful for cases when you need to get any point from any geometry fastest way possible.

Change History (7)

comment:1 by robe, 3 years ago

I question changing the behavior of ST_StartPoint when we have ST_PointOnSuface that already does that.

comment:2 by strk, 3 years ago

If the aim is "fast", ST_PointOnSurface isn't fast. Also, ST_StartPoint is about getting the "start" vertex, not a point on the "surface" of the object, so they are really not doing the same thing.

Rather, I question whether it is ok for standard-defined signatures to behave differently from specified, but I think we broke that rule already

comment:3 by kalenik, 3 years ago

I went through OGC specification and, yes, it doesn't describe how ST_StartPoint should behave for geometries that are not linestrings. Should implementer decide whether to return NULL or try to return best possible result? Returning something seems like better option than returning nothing but it is arguable.

comment:4 by strk, 3 years ago

Following the same approach, I was just hit by ST_ExteriorRing(<multipolygon-with-just-one-element>) also returning NULL. It would be good to have a general option for what to do in these cases.

comment:5 by robe, 3 years ago

Milestone: PostGIS 3.3.0PostGIS 3.2.0

Will if we are set on it and kalenik already provided a patch, can't think of why we don't just do it in 3.2.0, since we haven't called alpha yet. So pushing back to 3.2

comment:6 by robe, 3 years ago

Owner: changed from pramsey to robe

comment:7 by Regina Obe <lr@…>, 3 years ago

Resolution: fixed
Status: newclosed

In ffd29fe/git:

ST_StartPoint support any geometry Closes #4981
Closes https://github.com/postgis/postgis/pull/628

Note: See TracTickets for help on using tickets.