This topic describes the ST_RotateZ function. This function rotates a geometry object by specific radians about the z-axis.

Syntax

geometry  ST_RotateZ(geometry  geomA , float  rotRadians);

Parameters

Parameter Description
geomA The geometry object that you want to specify.
rotRadians The radian in the rotation.

Description

  • The ST_RotateZ(geomA,rotRadians) function is shorthand for the ST_Affine(geomA,1,0,0,0,cos(rotRadians),-sin(rotRadians), 0,sin(rotRadians), or cos(rotRadians),0,0,0) function.
  • This function supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

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)