Nome

ST_RotateZ — Rotates a geometry about the Z axis.

Sinossi

geometry ST_RotateZ(geometry geomA, float rotRadians);

Descrizione

Rotates a geometry geomA - rotRadians about the Z axis.

[Nota]

This is a synonym for ST_Rotate

[Nota]

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).

Migliorato: Nella 2.0.0 è stato introdotto il supporto per le superfici poliedriche, i triangoli e i TIN.

Availability: 1.1.2. Name changed from RotateZ to ST_RotateZ in 1.2.2

[Nota]

Prior to 1.3.4, this function crashes if used with geometries that contain CURVES. This is fixed in 1.3.4+

Questa funzione supporta il 3d e non distrugge gli z-index.

Questo metodo supporta le Curve e le Circular String.

Questa funzione supporta le Polyhedral Surface.

Questa funzione supporta i Triangoli e le Triangulated Irregular Network Surfaces (TIN).

Esempi

This example rotates a line 90 degrees around the Z axis.

Code
SELECT ST_RotateZ('LINESTRING(1 2 3,1 1 1)', pi()/2);
Output
LINESTRING(-2 1 3,-1 1 1)
Figure
Geometry figure for visual-st-rotatez-01

This example rotates a curved circle around the Z axis.

Code
SELECT ST_RotateZ(geom, pi()/2)
FROM (SELECT ST_LineToCurve(ST_Buffer('POINT(234 567)'::geometry, 3)) As geom) As foo;
Output
CURVEPOLYGON(CIRCULARSTRING(-567 237.00000000000003,-567 231.00000000000003,-567 237.00000000000003))
Figure
Geometry figure for visual-st-rotatez-02

Si veda anche

ST_Affine, ST_RotateX, ST_RotateY