> ## 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 (Python)

> Create a polygon built from the given LineString and sets the spatial reference system from the srid.

Create a polygon built from the given LineString and sets the spatial reference system from the srid.

SQL reference: [`ST_Polygon`](/reference/wherobots-db/geometry-data/editors/ST_Polygon)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_Polygon

ST_Polygon(line_string: ColumnOrName, srid: ColumnOrNameOrNumber) -> Column
```

## Parameters

<ParamField path="line_string" type="ColumnOrName" required>
  Closed linestring geometry column that describes the exterior ring of the polygon.
</ParamField>

<ParamField path="srid" type="ColumnOrNameOrNumber" required>
  Spatial reference system identifier.
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Polygon geometry column created from the input linestring.
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.