Forces the exterior rings of a polygon or multipolygon geometry to be oriented clockwise (CW) and the interior rings to be oriented counterclockwise (CCW).
Syntax
geometry ST_ForcePolygonCW(geometry geom);Parameters
| Parameter | Description |
|---|---|
geom | The input geometry. |
Description
Non-polygon geometries are returned unchanged.
3D geometries are supported. Z coordinates are preserved.
Geometries with M coordinates are supported.
Examples
SELECT ST_AsText(ST_ForcePolygonCW(ST_GeomFromText('POLYGON((1 1,2 1,2 2,1 2,1 1))')));Output:
st_astext
--------------------------------
POLYGON((1 1,1 2,2 2,2 1,1 1))
(1 row)该文章对您有帮助吗?