ST_ForceRHR

更新时间:
复制 MD 格式

Forces the orientation of polygon vertices to follow the right-hand rule, where the bounded area lies to the right of the boundary.

Syntax

geometry ST_ForceRHR(geometry g);

Parameters

ParameterDescription
gThe geometry object.

Description

  • Exterior rings are oriented clockwise; interior rings are oriented counterclockwise.

  • ST_ForceRHR is a synonym for ST_ForcePolygonCW.

  • Supports polyhedral surfaces.

  • Supports 3D objects and preserves z coordinates.

Examples

SELECT ST_AsText(ST_ForceRHR(ST_GeomFromText('POLYGON((1 1,2 1,2 2,1 2,1 1))')));
           st_astext
--------------------------------
 POLYGON((1 1,1 2,2 2,2 1,1 1))
(1 row)