st_geomfromewkt function

适用于:勾选为是 Databricks SQL 勾选为是 Databricks 运行时 18.0 及以上 版本 勾选是 Lakehouse//RT

注释

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

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

Syntax

st_geomfromewkt ( ewktExpr )

Arguments

  • ewktExpr:一个 STRING 值,表示扩展 WKT(EWKT) 格式中的几何体。

退货

GEOMETRY(ANY) 表示解析后的 EWKT 几何结构。 如果指定,则 SRID 是 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)