Forces the vertex orientation of a polygon to follow the Right-Hand Rule (RHR), so the bounded area lies to the right of the boundary.
Syntax
geometry ST_ForceRHR(geometry g);Parameters
| Parameter | Description |
|---|---|
g | The input geometry. |
Description
Exterior rings are oriented clockwise; interior rings are oriented anticlockwise.
ST_ForceRHRis a synonym forST_ForcePolygonCW.Supports polyhedral surfaces.
Supports 3D geometries and preserves z coordinates.
Examples
Basic example: 2D polygon
SELECT ST_AsText(ST_ForceRHR(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)该文章对您有帮助吗?