Orients a polygon's exterior ring counter-clockwise (CCW) and its interior rings clockwise (CW).
Syntax
geometry ST_ForcePolygonCCW(geometry geom);Parameters
| Parameter | Description |
|---|---|
geom | The input geometry. |
Usage notes
Non-polygon geometries are returned unchanged.
Supports 3D geometries. Z coordinates are preserved.
Supports geometries with M coordinates.
Examples
SELECT ST_AsText(ST_ForcePolygonCCW(ST_GeomFromText('POLYGON((1 1,1 2,2 2,2 1,1 1))')));Output:
st_astext
--------------------------------
POLYGON((1 1,2 1,2 2,1 2,1 1))
(1 row)该文章对您有帮助吗?