momepy.meshedness

momepy.meshedness(graph, radius=5, name='meshedness', distance=None)[source]

Calculates meshedness for subgraph around each node.

Subgraph is generated around each node within set radius. If distance=None, radius will define topological distance, otherwise it uses values in distance attribute.

\[\alpha=\frac{e-v+1}{2 v-5}\]

where \(e\) is the number of edges in subgraph and \(v\) is the number of nodes in subgraph.

Parameters:
graph : networkx.Graph

Graph representing street network. Ideally genereated from GeoDataFrame using momepy.gdf_to_nx()

radius: int

number of topological steps defining the extent of subgraph

name : str, optional

calculated attribute name

distance : str, optional

Use specified edge data key as distance. For example, setting distance=’weight’ will use the edge weight to measure the distance from the node n.

Returns:
Graph

networkx.Graph

References

Feliciotti A (2018) RESILIENCE AND URBAN DESIGN:A SYSTEMS APPROACH TO THE STUDY OF RESILIENCE IN URBAN FORM. LEARNING FROM THE CASE OF GORBALS. Glasgow.

Examples

>>> network_graph = mm.meshedness(network_graph, radius=800, distance='edge_length')