问题描述
我有一个跟踪应用程序和使用osmdroid库。我的prolbem是osmrdroid不支持路由。顺便说该应用程序纯粹是脱机。是否有可以与问候到支持路由库,可与osmdroid地图覆盖协调提供任何建议。我需要做的是只计算最短路径,并绘制它的离线地图从一个点到下一个上。
I have a tracking application and uses osmdroid library. My prolbem is that osmrdroid does not support routing. By the way the application is purely offline. Are there any suggestions that you can provide with regards to a library that supports routing, which can coordinate with the osmdroid map overlay. What I need to do is only calculate shortest path and draw it on the offline map from one point to the next.
我发现这个链接:<一href="http://$c$c.google.com/p/j2memaprouteprovider/source/browse/trunk/J2MEMapRouteAndroidEx/src/org/ci/geo/route/android/MapRouteActivity.java" rel="nofollow">http://$c$c.google.com/p/j2memaprouteprovider/source/browse/trunk/J2MEMapRouteAndroidEx/src/org/ci/geo/route/android/MapRouteActivity.java
但我不知道如何将其在osmdroid应用程序集成。
but I don't know how to integrate it on osmdroid application.
推荐答案
我觉得在所有osmdroid应用服务的地图数据来自于这样的code线:
I think in all osmdroid apps the map data come from a code line like this:
map.setTileSource(TileSourceFactory.MAPQUESTOSM);
这意味着地图下载栅格瓦片,或者如果你有一个离线应用的映射缓存为瓷砖。所以没有可能被用来计算一个路由的街道的曲线图。因此,路由是不是有原因的支持osmdroid。
This means the maps are downloaded as raster tiles, or if you have an offline application the maps are cached as tiles. So you do not have a graph of streets that could be used to calculate a route. So routing isn't supported in osmdroid for a reason.
要做到脱机路由计算,你将需要你的手机上的街道网络数据。然后你可以使用一个简单的寻路算法来计算最短路径。 (如 Dijkstra算法)
To do offline route calculation you will need the street network data on your phone. Then you can use a simple wayfinding algorithm to calculate the shortest path. (like Dijkstra)
这篇关于脱机路由库,可以一起去osmdroid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!