I'm trying plot just one neighborhood inside the Salvador City. I'd like to know if is possible separate the city in neighborhoods using the OSMnx. I need to get the statistics by neighborhoods.
Thanks!
I'm trying plot just one neighborhood inside the Salvador City. I'd like to know if is possible separate the city in neighborhoods using the OSMnx. I need to get the statistics by neighborhoods.
Thanks!
If OSM has polygonal boundaries for the neighborhoods, you can get stats for each:
import osmnx as ox
import pandas as pd
ox.config(log_console=True, use_cache=True)
# add more neighborhood names for which OSM has polygonal boundaries
places = ['Barra, Salvador, Bahia']
stats = {}
for place in places:
G = ox.graph_from_place(place, network_type='drive')
stats[place] = ox.basic_stats(G)
pd.DataFrame(stats).T