> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_ForcePolygonCCW

For (Multi)Polygon geometries, this function sets the exterior ring orientation to counter-clockwise and interior rings to clockwise orientation. Non-polygonal geometries are returned unchanged.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_ForcePolygonCCW/ST_ForcePolygonCCW.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=adec8b6fc1d4b0205711ab89b2d8d880" alt="ST_ForcePolygonCCW" width="500" height="300" data-path="images/sql-functions/ST_ForcePolygonCCW/ST_ForcePolygonCCW.svg" />

## Signatures

```sql theme={"system"}
ST_ForcePolygonCCW(geom: Geometry)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_AsText(ST_ForcePolygonCCW(ST_GeomFromText('POLYGON ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20))')))
```

```
POLYGON ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))
```
