Skip to main content
Assign a connected component id to each geometry based on the ST_DWithin predicate. Two geometries are in the same component if they are connected through any chain of geometries that are within the given distance of each other. SQL reference: ST_DWithinCC

Signature

Parameters

ColumnOrName
required
Geometry column or name.
Union[ColumnOrName, float]
required
The distance threshold.
Optional[Union[ColumnOrName, bool]]
default:"None"
Whether to use spheroid for distance calculation.
Optional[ColumnOrName]
default:"None"
Optional column to partition by before computing components.

Returns

Column
A long indicating the connected component id.