Chapter 9
Chapter 9
graph_from_polygon
graph_to_gdfs
# Download the road network for driving within the admin boundary
G = ox.graph_from_polygon(admin_poly, network_type='drive')
nodes
# Define the polygon for the admin boundary the 1st district of Budapest
admin_district = ox.geocode_to_gdf('1st district, Budapest')
admin_poly = admin_district.geometry.values[0]
# Download the road network for driving within the administrative boundary
G = ox.graph_from_polygon(admin_poly, network_type='drive')
In [3]: # Convert the network graph to GeoDataFrames for nodes and edges
nodes, edges = ox.graph_to_gdfs(G)
osmnx
matplotlib
length