Synopsis: ST - Affine ST - Rotatey ST - Rotatez
Synopsis: ST - Affine ST - Rotatey ST - Rotatez
1 Manual
131 / 315
Synopsis
geometry ST_RotateX(geometry geomA, float rotRadians);
Description
Rotate a geometry geomA - rotRadians about the X axis.
Note
ST_RotateX(geomA, rotRadians) is short-hand for ST_Affine(geomA, 1, 0, 0, 0, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0).
Examples
--Rotate a line 90 degrees along x-axis
SELECT ST_AsEWKT(ST_RotateX(ST_GeomFromEWKT(LINESTRING(1 2 3, 1 1 1)), pi()/2));
st_asewkt
--------------------------LINESTRING(1 -3 2,1 -1 1)
See Also
ST_Affine, ST_RotateY, ST_RotateZ
7.5.17 ST_RotateY
Name
ST_RotateY Rotate a geometry rotRadians about the Y axis.
Synopsis
geometry ST_RotateY(geometry geomA, float rotRadians);
Description
Rotate a geometry geomA - rotRadians about the y axis.
Note
Examples
--Rotate a line 90 degrees along y-axis
SELECT ST_AsEWKT(ST_RotateY(ST_GeomFromEWKT(LINESTRING(1 2 3, 1 1 1)), pi()/2));
st_asewkt
--------------------------LINESTRING(3 2 -1,1 1 -1)
See Also
ST_Affine, ST_RotateX, ST_RotateZ, Rotate around Point, Create Ellipse functions
7.5.18 ST_RotateZ
Name
ST_RotateZ Rotate a geometry rotRadians about the Z axis.
Synopsis
geometry ST_RotateZ(geometry geomA, float rotRadians);
Description
Rotate a geometry geomA - rotRadians about the Z axis.
Note
ST_RotateZ(geomA, rotRadians) is short-hand for SELECT ST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0, 1, 0, 0,
0).
Note
Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+
Examples