Name

ST_ForceRHR — Forces the exterior ring's vertices of a Polygon to follow right hand orientation.

Synopsis

geometry ST_ForceRHR(bytea Geometry);

Alias

ForceRHR

Description

Forces the exterior ring's vertices of a Polygon to follow right hand orientation.

[Note]

This function supports MultiPolygons and GeometryCollections

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsText(ST_ForceRHR(ST_GeomFromText('MULTIPOLYGON (((0 0, 10 0, 10 10, 0 10, 0 0)),((2 2, 4 2, 4 4, 2 4, 2 2)))')));
--Result
MULTIPOLYGON (((0 0, 0 10, 10 10, 10 0, 0 0)), ((2 2, 2 4, 4 4, 4 2, 2 2)))

SELECT ST_AsText(ST_ForceRHR(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(20 20),POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)))')));
--Result
GEOMETRYCOLLECTION (POINT (20 20), POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))

Related functions

ST_Reverse