共用方式為

st_setsrid 函数

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

重要

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

返回一个新 GEOMETRY 值,其 SRID 是指定的 SRID 值。

语法

st_setsrid ( geo, srid )

论据

  • geo:一个 GEOMETRY 值。
  • srid:几何图形的新 SRID 值。

退货

类型为 GEOMETRY 的值,表示其 SRID 为指定 SRID 值的新几何值。

如果任何输入为NULL,该函数将返回NULL

例子

-- Sets SRID to 3857 and returns the new SRID value.
> SELECT st_srid(st_setsrid(ST_GeomFromText('POINT(4 5)', 4326), 3857));
  3857
-- Returns the original geometry with new SRID.
> SELECT st_asewkt(st_setsrid(st_geomfromtext('POINT(1 2)'), 4326));
  SRID=4326;POINT(1 2)