python - 在 Python OSMNX 上的给定地图上绘制路线
问题描述
我有一个数据框,其中包含来自车辆的 GPS 数据。它有经度、纬度值和时间戳。我想在地图上可视化汽车的路线。
OSMNX 有一个函数“plot_graph_route”和“plot_graph_folium”,它将路线作为参数,但我不知道我应该给出什么样的结构。
解决方案
我不知道我应该给出什么样的结构
OSMnx 文档plot_graph_route
中完整描述了其参数的用法和结构。OSMnx 示例中记录了在 lat-lng 点之间绘制路线的技术,如下所示:
origin_point = (37.792896, -122.412325)
destination_point = (37.790495, -122.408353)
origin_node = ox.get_nearest_node(G, origin_point)
destination_node = ox.get_nearest_node(G, destination_point)
route = nx.shortest_path(G, origin_node, destination_node, weight='length')
fig, ax = ox.plot_graph_route(G, route, origin_point=origin_point, destination_point=destination_point)
文档和示例都类似地描述了该plot_graph_folium
功能。
推荐阅读
- django - SMTPSenderRefused at /users/password-reset/(530,b'5.5.1 需要身份验证。了解详情,请访问\n5.5.1 https://support.google.com/ma
- php - 数组变量未从 while 循环中打印出来
- javascript - 再次单击按钮后如何显示警报?
- c# - 带有 js 的 asp.net 网络表单
- excel - 如何过滤数据透视表以仅包含 2019 年的日期(多选)
- python - 使用 IPv6 的 uPNP / ssdp 发现
- azure - 有没有办法通过 Microsoft Graph-Api 撤销 Azure Active Directory 应用程序同意
- api - 在受限环境中使用移动应用程序保护 API 访问
- mysql - 上传文件(照片),将其作为字符串保存到本地文件夹(到数据库)并从特定文件夹显示为 jpg
- apache-spark - Spark:scala中数据集的动态过滤器