st_rotate function
Applies to: Databricks SQL
Databricks Runtime 17.1 and above
Preview
This feature is in Public Preview.
注記
This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types.
Rotates the input GEOMETRY value around the Z axis by the given rotation angle (in radians).
Syntax
st_rotate ( geoExpr, rotationAngle )
Arguments
geoExpr: AGEOMETRYvalue.rotationAngle: ADOUBLEvalue representing the rotation angle (in radians).
Returns
A value of type GEOMETRY, representing the rotated geometry.
The SRID value of the output GEOMETRY value is equal to that of the input value.
The dimension of the output GEOMETRY value is the same as that of the input value.
The function returns NULL if any of the inputs is NULL.
Examples
SQL
-- 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)