st_geomfromewkt 函数

适用于:选中“是” Databricks Runtime 18.0 及更高版本

重要

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

注释

此功能在 Databricks SQL 经典仓库上不可用。 若要详细了解 Databricks SQL 仓库,请参阅 SQL 仓库类型

分析扩展 Well-Known 文本 (EWKT) 描述中的几何图形,并返回相应的 GEOMETRY 值。 返回的 SRID 是 ewktExpr 中指定的 SRID,如果未指定,则为 0。

Syntax

st_geomfromewkt ( ewktExpr )

Arguments

退货

GEOMETRY(ANY) 表示已分析的 EWKT 几何图形。 SRID来自ewktExpr(若已指定),否则为0。 如果任何输入为NULL,该函数将返回NULL

错误条件

例子

-- Simple example where the input EWKT does not include an SRID specification. The SRID of the output defaults to 0.
> SELECT st_srid(st_geomfromewkt('POINT Z (1 2 3)'));
  0

-- Simple example where the input EWKT contains an SRID specification.
> SELECT concat_ws(';', st_srid(g)::STRING, st_astext(g)) FROM (SELECT st_geomfromewkt('SRID=3857;POINT Z (1 2 3)') AS g);
  3857;POINT Z (1 2 3)