I tried to download osm
map data and created routing data as in this document: https://github.com/graphhopper/graphhopper/blob/master/docs/android/index.md. Then I can show the map perfectly (you guys have done a really amazing work). However, the problem is that I could not get routing with the generated routing data. This is my country map -gh folder:
Here’s the code I used for calculating path:
GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon)
.setLocale(Locale.US)
.setAlgorithm(Algorithms.DIJKSTRA_BI);
req.getHints().put(Routing.INSTRUCTIONS, "false");
GHResponse resp = hopper.route(req);
time = sw.stop().getSeconds();
if (resp.getAll().isEmpty()) {
log("resp.getAll().isEmpty(): " + resp.getDebugInfo());
return null;
}
Here’s the logcat I got:
com.graphhopper.android I/GH: loading map
com.graphhopper.android I/GH: loading graph (1.0) ...
com.graphhopper.android I/GH: found graph car|MMAP_STORE|2D|no_turn_cost|5,15,4,3,5, nodes:1257789
com.graphhopper.android I/GH: Finished loading graph. Long press to define where to start and end the route.
com.graphhopper.android I/GH: calculating path ...
com.graphhopper.android I/GH: from:21.023161,105.831423 to:21.043471,105.866356
com.graphhopper.android I/GH: resp.getAll().isEmpty():
Perhaps it’s related to the 1.0-snapshot
version?