'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
So I got the following image
[enter image description here][1]
[1]: https://i.stack.imgur.com/5d5J1.png
the result was [motorway_link, trunk]
Solution 1:[1]
By default, OSMnx simplifies the graph unless you use simplify=False. See documentation for details:
Some of the resulting consolidated edges may comprise multiple OSM ways, and if so, their multiple attribute values are stored as a list.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gboeing |
