I'm using OSMNX to load an OpenStreetMap file of a city into NetworkX. Is there any way for me to see which attributes are stored in the graph? I believe OSMNX might for instance store the length of a street, or the type of road. I want to know what the names of the attributes are that I can access.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could either display the edges to see what's in them:
import osmnx as ox
G = ox.graph_from_place('Piedmont, California', network_type='drive')
print(G.edges(keys=True, data=True))
Or you could use OSMnx to convert the edges to a GeoDataFrame and inspect its columns:
edge_attributes = ox.graph_to_gdfs(G, nodes=False).columns
print(edge_attributes)