Skip to main content

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.

Computes spatial connected components across the entire dataframe using the ST_Touches predicate. Two geometries are in the same component if they touch (share boundary points but do not overlap interiors). Returns a component ID for each row. ST_TouchesCC
  • geometry is the geometry column to analyze.
  • partitionBy is an optional column to partition the data before computing connected components. When provided, the spatial predicate is only evaluated between rows that share the same partition value. This can significantly improve performance on large datasets.

Signatures

ST_TouchesCC(geometry: Geometry)
ST_TouchesCC(geometry: Geometry, partitionBy: Column)

Parameters

geometry
Geometry
required
The input geometry.
partitionBy
Column
The partition by value.

Return type

The connected component ID for each row.

Example

SELECT ST_TouchesCC(geom) FROM my_table
85899345920