适用于: Databricks Runtime 17.1 及更高版本
Important
此功能目前以公共预览版提供。
按给定旋转角度(以弧度为单位)围绕 Z 轴旋转输入 GEOMETRY
。
Syntax
st_rotate ( geoExpr, rotationAngle )
Arguments
-
geoExpr
:一个GEOMETRY
值。 -
rotationAngle
:一个DOUBLE
值,表示旋转角度(以弧度为单位)。
Returns
类型的 GEOMETRY
值,表示旋转的几何图形。
输出 GEOMETRY
值的 SRID 值等于输入值的 SRID 值。
输出 GEOMETRY
值的维度与输入值的维度相同。
如果任何输入为NULL
,该函数将返回NULL
。
Examples
-- Rotate a point around the Z axis by 90 degrees (i.e. pi/2 radians).
> SELECT st_astext(st_rotate(st_geomfromtext('POINT ZM (3 -2 40 27)'), pi() / 2))
POINT ZM (2 3 40 27)