momepy.
subgraph
Calculates all subgraph-based characters.
Generating subgraph might be a time consuming activity. If we want to use the same subgraph for more characters, subgraph allows this by generating subgraph and then analysing it using selected options.
Graph representing street network. Ideally generated from GeoDataFrame using momepy.gdf_to_nx()
momepy.gdf_to_nx()
radius defining the extent of subgraph
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.
distance=’weight’
weight
Calculate meshedness (True/False)
Calculate cul-de-sac length (True/False)
if 'sum', calculate total cds_length, if 'mean' calculate mean cds_length
'sum'
'mean'
name of attribute of node degree (momepy.node_degree())
momepy.node_degree()
name of attribute of segment length (geographical)
Calculate mean node degree (True/False)
Calculate proportion {3: True/False, 4: True/False, 0: True/False}
Calculate cyclomatic complexity (True/False)
Calculate edge node ratio (True/False)
Calculate gamma index (True/False)
Calculate local closeness centrality (True/False)
Use the specified edge attribute as the edge distance in shortest path calculations in closeness centrality algorithm
if True, shows progress bars in loops and indication of steps
networkx.Graph
Examples
>>> network_graph = mm.subgraph(network_graph)