图论在离线地图最短路径计算中的应用

发布于 2024-12-25 04:51:46 字数 143 浏览 3 评论 0原文

如何利用图论的概念在 Android 离线地图中查找最短路径?我正在使用 osmdroid 库和 mapnik 地图图块来显示地图。我现在的问题是如何根据用户最后已知的位置到目的地绘制和计算地图上的最短路径,并且该线应该沿着道路走。

我可以使用地理坐标吗?

How do I utilize the concept of Graph Theory in finding the shortest path in an offline map in Android? I am using osmdroid library and mapnik map tiles to display a map. My problem right now is how do I drawing and calculating the shortest path on the map basing from the user's last known location to his destination and the line should go along with the roads.

Can I utilize the geocoordinates?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无言温柔 2025-01-01 04:51:46

您可以将 GraphHopper (警告:我是开发者)与 mapforge(离线渲染器)。

有了这个 位置到 id 索引,您可以查询现实世界的纬度,经度坐标,您将获得图表的 ID。有了这个id,你可以通过 Graph 接口。

如果您需要更多信息来将其与 Mapforge 集成,请告诉我。对于桌面,已经有 粗略实施

You can use GraphHopper (warning: I'm the dev) in combination with mapforge (offline renderer).

And with this location to id index you can query real world lat,lon coordinates and you'll get id's of the graph. With that id's you can fetch the real lat,lon via the Graph interface.

Let me know if you need more info for integrating this with mapforge. For the desktop there is alreay a rough implementation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文