[GraphHopper] Geoposition of an edge

Peter K peathal at yahoo.de
Tue Apr 29 13:55:31 UTC 2014


Hey Phil,


> I think it is „fetchWayGeometry“ ? The fetch option should result a point list and in which way can you get a tip to get the correct point position. I know the edge has got e.g. 20 cells and I need the geoposition of the 5th cell. I don’t understand the matching between the point list and cell number.

You'll have to implement your own custom logic :)

E.g. just pick the first and the last point of that pointlist and
calculate latDistance and lonDistance. Then iterate in a loop

for(cell : cellsForThatEdge) {
  cell.set(lat, lon)
  lat+=latDistance
  lon+=lonDisatnce
}

> How can I get an EdgeIterator from an EdgeID, does exists anything like this.graph.getEdgeIterator(<EdgeID>)?

via graph.getEdgeProps(edgeId, Integer.MIN_VALUE)

Regards,
Peter.



More information about the GraphHopper mailing list