<div dir="ltr">Hello All,<div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div>
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...</div><div><br></div><div>
Kind regards,</div><div><br></div><div>Tim Lehner</div><div><br></div><div>P.S. my current implementation is below:</div><div><br></div><div><div><br></div><div> GHRequest req = new GHRequest(from.getLat(), from.getLon(), to.getLat(), to.getLon()).setVehicle("car");</div>
<div> GHResponse rsp = hopper.route(req);</div></div><div><br></div><div><div>// first check for errors</div><div> if(rsp.hasErrors()) {</div><div> // handle them!</div><div> // rsp.getErrors()</div>
<div> throw new Exception("GraphHopper response has errors!");</div><div> }</div><div><br></div><div> // route was found? e.g. if disconnected areas (like island)</div><div> // no route can ever be found</div>
<div> if(!rsp.isFound()) {</div><div> // handle properly</div><div> throw new Exception("No route possible, either start loc or end loc is isolated!");</div><div> }</div></div>
<div>List<GPXEntry> latLonRoute = il.createGPXList();<br></div><div><br></div></div>