Rotates a geometry object by a specified angle about the Z-axis.
Syntax
geometry ST_RotateZ(geometry geomA, float rotRadians);Parameters
| Parameter | Description |
|---|---|
geomA | The geometry object to rotate. |
rotRadians | The rotation angle, in radians. |
Description
ST_RotateZ(geomA, rotRadians)is shorthand forST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0, 1, 0, 0, 0).Supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D geometries.
Examples
SELECT ST_AsEWKT(ST_RotateZ('LINESTRING (1 2 1,2 2 1)'::geometry, pi()));
st_asewkt
-----------------------------
LINESTRING(-1 -2 1,-2 -2 1)
(1 row)该文章对您有帮助吗?