适用于:
Databricks Runtime 18.0 及更高版本
重要
此功能目前以公共预览版提供。
注释
此功能在 Databricks SQL 经典仓库上不可用。 若要详细了解 Databricks SQL 仓库,请参阅 SQL 仓库类型。
分析扩展 Well-Known 文本 (EWKT) 描述中的几何图形,并返回相应的 GEOMETRY 值。 返回的 SRID 是 ewktExpr 中指定的 SRID,如果未指定,则为 0。
Syntax
st_geomfromewkt ( ewktExpr )
Arguments
-
ewktExpr:一个STRING值,表示 采用扩展 WKT (EWKT) 格式的几何图形。
退货
GEOMETRY(ANY) 表示已分析的 EWKT 几何图形。 SRID来自ewktExpr(若已指定),否则为0。
如果任何输入为NULL,该函数将返回NULL。
错误条件
- 如果
ewktExpr的值是无效的 扩展 WKT (EWKT) 描述,则函数返回 EWKT_PARSE_ERROR。
例子
-- 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)
相关函数
-
st_asbinary函数 -
st_asewkb函数 -
st_asewkt函数 -
st_asgeojson函数 -
st_astext函数 -
st_geogfromewkt函数 -
st_geogfromgeojson函数 -
st_geogfromtext函数 -
st_geogfromwkb函数 -
st_geogfromwkt函数 -
st_geomfromewkb函数 -
st_geomfromgeojson函数 -
st_geomfromtext函数 -
st_geomfromwkb函数 -
st_geomfromwkt函数 -
to_geography函数 -
to_geometry函数 -
try_to_geography函数 -
try_to_geometry函数