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

> Extract a specific type of geometry from a geometry collection column as a multi-geometry column.

Extract a specific type of geometry from a geometry collection column
as a multi-geometry column.

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

## Signature

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

ST_CollectionExtract(
    collection: ColumnOrName,
    geom_type: Optional[Union[ColumnOrName, int]] = None,
) -> Column
```

## Parameters

<ParamField path="collection" type="ColumnOrName" required>
  Column for the geometry collection.
</ParamField>

<ParamField path="geom_type" type="Optional[Union[ColumnOrName, int]]" default="None">
  Type of geometry to extract where 1 is point, 2 is linestring, and 3 is polygon, if None then the highest dimension geometry is extracted, defaults to None
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Multi-geometry column containing all geometry from collection of the selected type.
</ResponseField>


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