> ## 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_Polygon

Function to create a polygon built from the given LineString and sets the spatial reference system from the srid

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

## Signatures

```sql theme={"system"}
ST_Polygon(geom: Geometry, srid: Integer)
```

## Parameters

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

<ParamField body="srid" type="Integer" required>
  Spatial Reference Identifier.
</ParamField>

## Return type

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

## Example

```sql theme={"system"}
SELECT ST_AsText( ST_Polygon(ST_GeomFromEWKT('LINESTRING(75 29 1, 77 29 2, 77 29 3, 75 29 1)'), 4326) );
```

```
POLYGON((75 29 1, 77 29 2, 77 29 3, 75 29 1))
```
