cartagen.detect_dead_ends#
- detect_dead_ends(roads, outside_faces=False)#
Detect dead-ends groups.
This function detects dead-ends groups inside a road network. A dead-end group is a connected group of road sections that overlaps the border of only one network face. A connected group of road sections not connected to the rest of the network are considered dead-ends.
- Parameters:
roads (
GeoDataFrameofLineString) – The road network.outside_faces (
bool, optional) – Whether dead-ends should be calculated on the outside faces of the road network. This can induce wrong characterization on the border of the provided dataset.
- Returns:
roads (
GeoDataFrameofLineString) – The input road network with new attributes:’deadend’: boolean indicating whether the road is part of a dead-end group.
’face’: Index of the network face it belongs to.
’deid’: Index of the dead end group inside a given face.
’connected’: Set to true if the dead end group is connected to the network.
’root’: Set to true if the road section is the root of the dead end group, i.e. the section connecting the dead end group to the road network.
’hole’: Set to true if the road section touches a hole inside the dead end group.
See also