i am trying to get lat/lon of base and adj node of an EdgeIteratorState e. I am routing and getting the paths from the routing request. From the Path objects i get the EdgeIteratorStates.
I do it like so:
double lat = this.getGraphHopperStorage().getNodeAccess().getLatitude(e.getBaseNode());
double lon = this.getGraphHopperStorage().getNodeAccess().getLongitude(e.getBaseNode());
double latadj = this.getGraphHopperStorage().getNodeAccess().getLatitude(e.getAdjNode());
double lonadj = this.getGraphHopperStorage().getNodeAccess().getLongitude(e.getAdjNode());
This works for most edges. But in some cases (2 times per route calculation) I get edges with short lengths of some meters which but one of the two nodes lies 1000 km away.
An example:
edgeid: 23883882
base: 53.45419410886304, 10.13771746615434;
adj: 47.80398136684257, 10.344953879973751;
length of edge: 75.45741857808768 m
speed: 45.0
waygeometry: (47.80348739333795,10.34522731628777,741.0), (47.80375542798092,10.345045708381662,741.0), (47.80398136684257,10.344953879973751,733.0)
What i am doing wrong? Is there another way to query the nodes attributes?
Do you eventually mean the problem with virtual nodes? Are the edgestates coming from an algorithm feeded with the QueryGraph?
Instead of the 'graph storage' you would need this 'query graph' to answer these requests properly.
Also we should fail for those requests instead of silently allowing them, see the issue here: https://github.com/graphhopper/graphhopper/issues/642