[英]finding way ids for list of osm nodes in shortest path
In a route, we get a list of all the nodes from the source to destination. 在一条路线中,我们获得了从源到目的地的所有节点的列表。
route = nx.shortest_path(G,origin_node,desitination_node, weight='length')
Is it possible to get all the osm way ids from source to destination? 是否可以从源到目的地获取所有osm方式ID?
Yes, the route is a list of nodes. 是的,路由是节点列表。 Iterate through this list pairwise to get edge (u, v) tuples (for instance see https://stackoverflow.com/a/4628446/7321942 ).
成对遍历此列表以获取边缘(u,v)元组(例如,请参见https://stackoverflow.com/a/4628446/7321942 )。 Look up those edge tuples in the graph to get the constituent OSM way IDs corresponding to those edges.
在图中查找那些边缘元组,以获取与那些边缘相对应的OSM方式ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.