Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns the last point of the input GEOGRAPHY
or GEOMETRY
value, if the input geospatial value is a non-empty linestring.
Syntax
st_endpoint ( geoExpr )
Arguments
geoExpr
: AGEOGRAPHY
orGEOMETRY
value representing a linestring.
Returns
A value of type GEOGRAPHY
or GEOMETRY
, representing the last point of the linestring.
The SRID value of the output point is the same as that of the input value.
The dimension of the output point is the same as that of the input linestring.
The function returns NULL
if the input is NULL
.
Error conditions
- If the value of
geoExpr
is not a linestring, the function returns ST_INVALID_ARGUMENT_TYPE. - If the value of
geoExpr
is an empty linestring, the function returns ST_INVALID_ARGUMENT_TYPE.
Examples
-- Returns the endpoint of a linestring geometry.
> SELECT st_asewkt(st_endpoint(st_geomfromtext('LINESTRING(1 2,3 4,5 6)', 4326)))
SRID=4326;POINT(5 6)
-- Returns the endpoint of a linestring geography with Z and M coordinates.
> SELECT st_asewkt(st_endpoint(st_geogfromtext('LINESTRING ZM (1 2 3 4,5 6 7 8)')))
SRID=4326;POINT ZM (5 6 7 8)