为什么我将获取的路网数据转成geodataframes结构时,在highway栏中出现list元素?
When I convert the obtained road network data into a geodataframes structure, why does the list element appear in the highway column?
import osmnx as ox
G = ox.graph_from_place('成都市',network_type='all')
G = ox.project_graph(G)
ox.plot_graph(G)
# 将图形转换为节点和边的GeoDataFrames类型
gdf_nodes, gdf_edges = ox.graph_to_gdfs(G)
gdf_edges
所以我得到了下图
[在此处输入图片描述][1]
[1]: https://i.stack.imgur.com/5d5J1.png
结果是 [motorway_link, trunk]
默认情况下,OSMnx 会简化图表,除非您使用 simplify=False
。详情见documentation:
Some of the resulting consolidated edges may comprise multiple OSM ways, and if so, their multiple attribute values are stored as a list.
import osmnx as ox
G = ox.graph_from_place('成都市',network_type='all')
G = ox.project_graph(G)
ox.plot_graph(G)
# 将图形转换为节点和边的GeoDataFrames类型
gdf_nodes, gdf_edges = ox.graph_to_gdfs(G)
gdf_edges
所以我得到了下图
[在此处输入图片描述][1]
[1]: https://i.stack.imgur.com/5d5J1.png
结果是 [motorway_link, trunk]
默认情况下,OSMnx 会简化图表,除非您使用 simplify=False
。详情见documentation:
Some of the resulting consolidated edges may comprise multiple OSM ways, and if so, their multiple attribute values are stored as a list.