st_m 函数

适用于:已勾选“是”的 Databricks Runtime 17.1 及更高版本

重要

此功能目前以公共预览版提供。

返回输入点 GEOMETRY的 M 坐标,或者 NULL 该点为空或没有 M 坐标。

语法

st_m ( geoExpr )

论据

  • geoExpr:一个 GEOMETRY 值。

退货

类型为DOUBLE的值,即输入点GEOMETRY的M坐标。

如果输入为NULL或点为空,则函数返回NULL

例子

-- 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