PostGIS 1.5.
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).
Availability: 1.1.2. Name changed from RotateX to ST_RotateX in 1.2.2
This function supports 3d and will not drop the z-index.
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
ST_RotateY(geomA, rotRadians) is short-hand for ST_Affine(geomA, cos(rotRadians), 0,
sin(rotRadians), 0, 1, 0, -sin(rotRadians), 0, cos(rotRadians), 0, 0, 0).
Availability: 1.1.2. Name changed from RotateY to ST_RotateY in 1.2.2
This function supports 3d and will not drop the z-index.
PostGIS 1.5.1 Manual
132 / 315
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).
Availability: 1.1.2. Name changed from RotateZ to ST_RotateZ in 1.2.2
Note
Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves
Examples