Name

ST_RotateZ — 绕Z轴旋转几何图形。

Synopsis

geometry ST_RotateZ(geometry geomA, float rotRadians);

描述

绕Z轴旋转几何图形A-rotRadians。

[Note]

这是ST_Rotate的同义词

[Note]

ST_RotateZ(geomA, rotRadians) 是以下的缩写 SELECT ST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0, 1, 0, 0, 0)

增强:2.0.0引入了对多面体曲面、三角形和三角网的支持。

可用性:1.1.2。在1.2.2中将名称从RotateZ更改为ST_RotateZ

[Note]

在1.3.4之前的版本中,如果与包含曲线的几何体一起使用,此函数会崩溃。这在1.3.4+中已修复

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves

This function supports Polyhedral surfaces.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

示例

--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(geom, pi()/2))
FROM (SELECT ST_LineToCurve(ST_Buffer(ST_GeomFromText('POINT(234 567)'), 3)) As geom) As foo;

                                                                                                           st_asewkt
----------------------------------------------------------------------------------------------------------------------------
 CURVEPOLYGON(CIRCULARSTRING(-567 237,-564.87867965644 236.12132034356,-564 234,-569.12132034356 231.87867965644,-567 237))

另请参阅

ST_Affine, ST_RotateX, ST_RotateY