[GraphHopper] Routing has gaps
Timothy Lehner
tim at accelogress.com
Mon Aug 4 13:22:06 UTC 2014
Hello All,
I am trying to use graph hopper to calculate routes in a customised Open
Street Map map. I have set up the graph and currently routing works, but
the resulting route is expressed as a list of lat-long points and has gaps.
For example, if my OpenStreetMap has a few close packed nodes, the route
calulcated will have maybe two latLong points. The lat long points of the
nodes in between are missed.
I was wondering if there is any way to get routes expressed as a list of
node ids, detailing the exact order that adjacent nodes need to be
traversed, if a node is skipped I cannot use the route...
Kind regards,
Tim Lehner
P.S. my current implementation is below:
GHRequest req = new GHRequest(from.getLat(), from.getLon(),
to.getLat(), to.getLon()).setVehicle("car");
GHResponse rsp = hopper.route(req);
// first check for errors
if(rsp.hasErrors()) {
// handle them!
// rsp.getErrors()
throw new Exception("GraphHopper response has errors!");
}
// route was found? e.g. if disconnected areas (like island)
// no route can ever be found
if(!rsp.isFound()) {
// handle properly
throw new Exception("No route possible, either start loc or end
loc is isolated!");
}
List<GPXEntry> latLonRoute = il.createGPXList();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140804/bfea1990/attachment.html>
More information about the GraphHopper
mailing list