Name

CG_Rotate — Rotates a geometry by a given angle around the origin (0,0).

Synopsis

geometry CG_Rotate(geometry geom, float8 angle);

描述

Rotates the input geometry geom by angle radians around the origin point (0,0). The rotation is performed in 2D space; Z coordinates are not modified. Positive angles rotate the geometry counter-clockwise.

Availability: 3.6.0 - requires SFCGAL >= 2.0.0

该方法需要SFCGAL后端。

示例

SELECT ST_AsText(CG_Rotate('LINESTRING(1 0, 0 1)', pi()/2));
-- Result: LINESTRING(0 1, -1 0)

相关信息

CG_Rotate2D, ST_Rotate