Name

ST_ForceRHR — 强制多边形中顶点的方向遵循右手规则。

Synopsis

geometry ST_ForceRHR(geometry g);

描述

强制多边形中顶点的方向遵循右手规则,在该规则中,由多边形界定的区域位于边界的右侧。具体地,外环以顺时针方向定向,而内环以逆时针方向定向。此函数是以下项的同义词 ST_ForcePolygonCW

[Note]

上述右手规则的定义与其他上下文中使用的定义冲突。为避免混淆,建议使用ST_ForcePolygonCW。

增强:引入了对多面体曲面的2.0.0支持。

This function supports 3d and will not drop the z-index.

This function supports Polyhedral surfaces.

示例

SELECT ST_AsEWKT(
  ST_ForceRHR(
        'POLYGON((0 0 2, 5 0 2, 0 5 2, 0 0 2),(1 1 2, 1 3 2, 3 1 2, 1 1 2))'
  )
);
                                                  st_asewkt
--------------------------------------------------------------
 POLYGON((0 0 2,0 5 2,5 0 2,0 0 2),(1 1 2,3 1 2,1 3 2,1 1 2))
(1 row)

另请参阅

ST_ForcePolygonCCW , ST_ForcePolygonCW , ST_IsPolygonCCW , ST_IsPolygonCW , ST_BuildArea, ST_Polygonize, ST_Reverse