名前

ST_RotateZ — ジオメトリをZ軸についてrotRadiansぶん回転させます。

概要

geometry ST_RotateZ(geometry geomA, float rotRadians);

説明

ジオメトリをZ軸についてrotRadiansぶん回転させます。

[注記]

この関数はST_Rotateと同じです。

[注記]

ST_RotateZ(geomA, rotRadians)SELECT ST_Affine(geomA, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0, 1, 0, 0, 0)の短縮版です。

Enhanced: 2.0.0 多面体サーフェス対応、三角対応、TIN対応が導入されました。

Availability: 1.1.2 1.2.2でRotateZからST_RotateZに名称変更しました。

[注記]

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

-- ラインをZ軸について90度回転
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)

-- 曲線化した円をZ軸について回転
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))

関連情報

ST_Affine, ST_RotateX, ST_RotateY