momepy.stroke_connectivity#

momepy.stroke_connectivity(stroke_graph)[source]#

Computes the stroke’s connectivity. Connectivity is defined as the number of street segments a stroke intersects. Comparing to the degree, the same stroke can intersects via several street segments with another stroke.

Adapted from [El Gouj et al., 2022].

Parameters:
stroke_graph: nx.Graph()

Stroke graph of a network, generated with momepy.coins_to_nx().

Returns:
stroke_graph: nx.Graph()

Returns stroke_graph where each node has acquired the additional attribute stroke_connectivity.

Examples

>>> stroke_graph = stroke_connectivity(stroke_graph)