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

> Assign a connected component id to each geometry based on the ST_Touches predicate.

Assign a connected component id to each geometry based on the ST\_Touches predicate.

Two geometries are in the same component if they are connected through any chain
of geometries that touch each other.

SQL reference: [`ST_TouchesCC`](/reference/wherobots-db/geometry-data/predicates/ST_TouchesCC)

## Signature

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

ST_TouchesCC(
    geometry: ColumnOrName,
    partition_by: Optional[ColumnOrName] = None,
) -> Column
```

## Parameters

<ParamField path="geometry" type="ColumnOrName" required>
  Geometry column or name.
</ParamField>

<ParamField path="partition_by" type="Optional[ColumnOrName]" default="None">
  Optional column to partition by before computing components.
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  A long indicating the connected component id.
</ResponseField>


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