st_z 函数

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

重要

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

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

语法

st_z ( geoExpr )

论据

  • geoExpr:一个 GEOMETRY 值。

退货

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

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

例子

-- Returns the Z coordinate of a non-empty point geometry with a Z coordinate.
> SELECT st_z(st_geomfromtext('POINT Z (1 2 3)'));
  3.0
-- Returns the Z coordinate of a non-empty point geometry without a Z coordinate.
> SELECT st_z(st_geomfromtext('POINT M (2 3 4)'));
  NULL
-- Returns `NULL` for an empty point geometry.
> SELECT st_z(st_geomfromtext('POINT ZM EMPTY'));
  NULL