Skip to main content
Assign a connected component id to each geometry based on the ST_Within predicate. Two geometries are in the same component if they are connected through any chain of geometries where one is within another. SQL reference: ST_WithinCC

Signature

Parameters

ColumnOrName
required
Geometry column or name.
Optional[ColumnOrName]
default:"None"
Optional column to partition by before computing components.

Returns

Column
A long indicating the connected component id.