[GraphHopper] Getting lat lon pairs of an edge

Peter graphhopper at gmx.de
Sun Jun 14 12:29:07 UTC 2015


Hi Karim,

> 1. Given an Edge ID, how to get the (lat,lon) pairs that connect it?

via:

graph.getEdgeProps(edgeId, Integer.MIN_VALUE)
na = graph.getNodeAccess()
lat1/lon1 = na.getLat/Lon(edgeIteratorState.getBaseNode)
lat2/lon2 = na.getLat/Lon(edgeIteratorState.getAdjNode)


> 2. Given a single (lat, lon) pair, how to get which edge ID it belongs
> to? Because, with Map-matching, I will need atlas 2 points.

If you have multiple GPS points you should consider using the map
matching component <https://github.com/graphhopper/map-matching>.
Otherwise use the locationIndex.findClosest

Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150614/cfda5c29/attachment.html>


More information about the GraphHopper mailing list