st_m
function
Applies to: Databricks Runtime 17.1 and above
Preview
This feature is in Public Preview.
Returns the M coordinate of the input point GEOMETRY
, or NULL
if the point is empty or does not have an M coordinate.
Syntax
st_m ( geoExpr )
Arguments
geoExpr
: AGEOMETRY
value.
Returns
A value of type DOUBLE
, M coordinate of the input point GEOMETRY
.
The function returns NULL
if the input is NULL
or if the point is empty.
Examples
SQL
-- Returns the M coordinate of a non-empty point geometry with an M coordinate.
> SELECT st_m(st_geomfromtext('POINT M (2 3 4)'));
4.0
-- Returns the M coordinate of a non-empty point geometry without an M coordinate.
> SELECT st_m(st_geomfromtext('POINT Z (1 2 3)'));
NULL
-- Returns `NULL` for an empty point geometry.
> SELECT st_m(st_geomfromtext('POINT ZM EMPTY'));
NULL