I would like a functionality to convert a larger street network to one with less amount of nodes: Created by merging nodes that are closer than a threshold.
Sample usage would be something like:
>>> G = ox.graph_from_address("Berlin, Germany", distance=1000, distance_type='bbox')
>>> G.number_of_nodes(), G.number_of_edges()
(2417, 6163)
>>> H = ox.simplify.coarse_grain(G, radius=100) # collapses all nodes within 100m radius
>>> H.number_of_nodes(), H.number_of_edges() # H is a smaller graph
(800, 2400)
I would like a functionality to convert a larger street network to one with less amount of nodes: Created by merging nodes that are closer than a threshold.
Sample usage would be something like: