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 first point of the input GEOGRAPHY
or GEOMETRY
value, if the input geospatial value is a non-empty linestring. Otherwise, returns NULL
.
Syntax
st_startpoint ( geoExpr )
Arguments
geoExpr
: AGEOGRAPHY
orGEOMETRY
value representing a linestring.
Returns
A value of type GEOGRAPHY
or GEOMETRY
, representing the first 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 first point of linestring with SRID.
> SELECT st_asewkt(st_startpoint(st_geomfromtext('LINESTRING(1 2,3 4,5 6)', 4326)))
SRID=4326;POINT(1 2)
-- Returns first point with ZM coordinates.
> SELECT st_asewkt(st_startpoint(st_geogfromtext('LINESTRING ZM (1 2 3 4,5 6 7 8)')))
SRID=4326;POINT ZM (1 2 3 4)