[GraphHopper] Mapping node id to lat/lon

Emden R. Gansner erg at research.att.com
Tue Dec 9 22:47:32 UTC 2014


On 12/8/14 6:14 PM, Thi Nguyen wrote:
> You can use getLat() and getLon() in NodeAccess, if I understand your question correctly.
Thanks. I wasn't clear enough. A node in the OSM file possesses an id field. Is there some way to 
use that number to
get the corresponding latitude and longitude or, equivalently, to get the internal id? Or perhaps I 
am not accessing the
right class implementing NodeAccess. I tried using

      int nodeId = .... // id from OSM file
      GraphHopper hopper = ....  // graph has been loaded
      GraphStorage graph = hopper.getGraph();
      double lat = graph.getNodeAccess().getLatitude(nodeId);   // array out of bounds error

Again thanks.





More information about the GraphHopper mailing list