ST_ForceRHR — Forces the exterior ring's vertices of a Polygon to follow right hand orientation.
geometry ST_ForceRHR(
bytea
Geometry)
;
Forces the exterior ring's vertices of a Polygon to follow right hand orientation.
This function supports MultiPolygons and GeometryCollections |
2D | 3D | M |
---|---|---|
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 |
---|---|---|---|
- | - | - | - |
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)))