简体   繁体   English

在最短路径中找到osm节点列表的方式ID

[英]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.

相关问题 Python:NetworkX查找包含给定节点列表的最短路径 - Python: NetworkX Finding shortest path which contains given list of nodes 在负权重的加权DAG中找到两个节点之间的最短路径 - Finding shortest path between two nodes in a weighted DAG with negative weights 在具有循环节点的复杂数据结构中查找最短路径 - Finding the shortest path in a complex data structure with looping nodes Networkx:查找到Graph中多个节点之一的最短路径 - Networkx: Finding the shortest path to one of multiple nodes in Graph 查找部分节点的所有对最短路径 - Finding all-pairs shortest path for a portion of nodes 双向A *找不到最短路径 - Bidirectional A* not finding the shortest path 查找必须使用两个节点列表中的任何两个节点的最短路径 - Finding shortest path where any two nodes from two lists of nodes must be used 到选定节点的总体最短路径 - Overall shortest path to selected nodes 如何在 Python 中的仅节点图中找到输入节点列表的最短路径 - How to find the shortest path of inputted list of nodes in nodes-only graph in Python 使用 R / igraph,有没有办法在考虑到唯一节点属性的计数的情况下找到节点之间的最短路径? - Using R / igraph, is there a way to find a shortest path between nodes taking the count of unique node attributes into account?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM