ST_STARTPOINT & ST_ENDPOINT for multi-part features

386
1
05-21-2022 12:10 AM
Status: Open
Bud
by
Notable Contributor

SDE.ST_GEOMETRY in Oracle:

Currently, the ST_STARTPOINT function can only be used for single-part features (aka a linestring).

If we try to use ST_STARTPOINT on multi-part features (multilinesting) then the function fails. We are forced to workaround that limitation by isolating a specific part/geometry from the multi-part feature, which only adds to the complexity and slowness of a query.
sde.st_startpoint(sde.st_geometryn(shape, 1))

It would be better if ST_STARTPOINT would just get the first point of the first part — by default.

The same applies to ST_ENDPOINT. It would be better if it would just get the last point of the last part — by default. The workaround is too complicated/slow:
sde.st_endpoint(sde.st_geometryn(shape, sde.st_numgeometries(shape)))


Could ST_STARTPOINT and ST_ENDPOINT be improved with better support for multi-part features?

For what it's worth, if that enhancement were implemented, we would still have the option to get the startpoint or endpoint of a specific part, if we wanted to. So that functionality wouldn't be lost.
sde.st_startpoint(sde.st_geometryn(shape, n))

 

Edit: The ST_PointN function has the same problem.

1 Comment
Bud
by

Like this:

select
sdo_lrs.geom_segment_end_pt(
sdo_geometry('MULTILINESTRING((1 2,3 4),(5 6,7 8))') )
from
dual

Result:
{
"point" : {
"optimized" : false,
"directposition" : [7,8]
}
}

https://livesql.oracle.com/apex/livesql/s/nim5rs77hz9dytq5qxbvox7xd