[GraphHopper] Improve route's geometry
Nicolas Gillet
nicolas.gillet at market-ip.com
Tue May 14 13:56:42 UTC 2013
Hello,
I noticed that routes are computed only between the graph's nodes, and the route does not go close enough to the actual GPS points.
I also noticed that there is a small mistake when selecting the start/end node when the GPS point falls on an "one way" edge.
The current behavior is to find the closest edge to the lon/lat coordinates and then find the closest node on this edge to the lon/lat.
When an edge is one way, you don't have to take the closes node on the edge but the node that will respect the traffic flow.
Mean if your starting point fall on an one way edge, you'll have to start the routing form the end point of this edge, no matter the starting point may be closer to your GPS coordinates. Indeed, if you go from you gps point to the start node, you'll have to violate the one way restriction.
(see attachment as example)
In this picture we also see the first thing I mentioned : the geometry lacks of accuracy between nodes and GPS coordinates ; the blue line does not "stop" exactly at the two little flags representing my GPS coordinates. (green flag: start, red flag : end)
I started digging into the code in order to solve these two issues and I came up thinking that the whole API needs a bit of rework.
Right now the node resolution returns a node ID but I think it should rather return an EdgeIterator of the matched edge.
With this edge, it's possible to find the appropriate start/end node depending on the lon/lat of the point and the fact that edge is one way. It's also possible "finish" the road and compute the missing/exceeding parts of the road.
Am I missing something ?
Do you think that my point of view is correct ?
Thank you
Nicolas GILLET
Market-IP - Creating Mobile Intelligence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130514/84afe2b7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrong way.png
Type: image/png
Size: 155761 bytes
Desc: wrong way.png
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130514/84afe2b7/attachment-0001.png>
More information about the GraphHopper
mailing list