momepy.coins_to_nx#
- momepy.coins_to_nx(coins)[source]#
Creates the continuity stroke graph of a street network. The continuity graph is similar to, but not identical with, the dual graph. In the continuity graph, each stroke (see
momepy.COINS) is a node; and each intersection between two strokes is an edge.- Parameters:
- coins: momepy.COINS
Continuity strokes computed from a street network.
- Returns:
- stroke_graphGraph
A networkx.Graph object.
Examples
>>> import geopandas as gpd >>> gdf = gpd.read_file(momepy.datasets.get_path("bubenec"), layer="streets") >>> coins = momepy.COINS(gdf) >>> stroke_graph = momepy.coins_to_nx(coins)