python中osmnx库的ox.graph_from_bbox()函数给出了不完整的图
我有一个代码,该代码提供了从源点到目标点的路由。 在以下代码中,Origin_lat和Origin_long是源坐标,dest_lat和dest_long是目标坐标,
G = ox.graph_from_bbox(origin_lat,dest_lat,origin_long,dest_long, network_type='drive')
origin_point = (origin_lat, origin_long)
destination_point = (dest_lat, dest_long)
origin_node = ox.get_nearest_node(G, origin_point,method='euclidean')
destination_node = ox.get_nearest_node(G, destination_point,method='euclidean')
route = nx.shortest_path(G, origin_node, destination_node, weight='travel_time')
但对于某些坐标,我没有从源到目的地的完整路线。我已经连接了输出的屏幕截图,其中我已经在ScatterMapbox上绘制了路由 image 黑色路由未达到源和目的地,表示图本身不完整。任何人都可以帮助我。
I have a piece of code which provides the route from a source point to destination point.
In the below code, origin_lat and origin_long are the source coordinates and dest_lat and dest_long are the destination coordinates
G = ox.graph_from_bbox(origin_lat,dest_lat,origin_long,dest_long, network_type='drive')
origin_point = (origin_lat, origin_long)
destination_point = (dest_lat, dest_long)
origin_node = ox.get_nearest_node(G, origin_point,method='euclidean')
destination_node = ox.get_nearest_node(G, destination_point,method='euclidean')
route = nx.shortest_path(G, origin_node, destination_node, weight='travel_time')
But for some coordinates, I am not getting a complete route from source to destination. I have attached the screenshot of the output where I have plotted the route on ScatterMapbox image
The black route is not reaching the source and destination, means the graph itself is incomplete. Can anyone help me out with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论