ST_RotateZ — Rotate a geometry rotRadians about the Z axis.
geometry ST_RotateZ(geometry geomA, float rotRadians);
Rotate a geometry geomA - rotRadians about the Z axis.
| ![[Note]](images/note.png) | |
| 
 | 
Availability: 1.1.2. Name changed from RotateZ to ST_RotateZ in 1.2.2
| ![[Note]](images/note.png) | |
| 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 function supports 3d and will not drop the z-index.
 This method supports Circular Strings and Curves
 This method supports Circular Strings and Curves
--Rotate a line 90 degrees along z-axis
SELECT ST_AsEWKT(ST_RotateZ(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), pi()/2));
		 st_asewkt
---------------------------
 LINESTRING(-2 1 3,-1 1 1)
 --Rotate a curved circle around z-axis
SELECT ST_AsEWKT(ST_RotateZ(the_geom, pi()/2))
FROM (SELECT ST_LineToCurve(ST_Buffer(ST_GeomFromText('POINT(234 567)'), 3)) As the_geom) As foo;
													   st_asewkt
----------------------------------------------------------------------------------------------------------------------------
 CURVEPOLYGON(CIRCULARSTRING(-567 237,-564.87867965644 236.12132034356,-564 234,-569.12132034356 231.87867965644,-567 237))