Routing along service instead along motorway
Brought to you by:
james22
When calculating a short route
from www.openstreetmap.org/?mlat=48.03317&mlon=11.4292&zoom=16
a few hundret meters to the north at http://www.openstreetmap.org/?mlat=48.0407&mlon=11.43729&zoom=16
the route goes along the highway=service instead of the highway=motorway.
The motorway has maxspeed=none the highway=service is set to 30kmh in the style file.
In this case the route should go along the motorway.
Hmm... this might be the issue from http://sourceforge.net/tracker/index.php?func=detail&aid=3518247&group_id=192084&atid=939974 .
So it might be that GpsMid's route calculation chooses the motorway but when the route line is resolved it falsely assumes the service street as the way between the two route nodes.
A way to reduce those wrongly detected route paths would be to store the eay types in the route connections as started at http://sourceforge.net/tracker/?func=detail&aid=3314758&group_id=192084&atid=939976 . With this GpsMid could easily identify the motorway during route line resolving as the calculated path between the route nodes.
Lately I had a 700 km route mostly over motorways and this problems happened maybe 10 times.
I never never understood the routing code itself.
But your patch to store the speed in the way descriptions sound interesting.
I wouldn't be mind, if this would remove the possibility to load older map formats this time.
One idea from me would be to memorize the way id exiting a route node during route calculation. This shouldn't be very memory intensive, since loading route tiles needs most of the memory.
The routing code is split between calculating the route nodes used on the route path with the A* algorithm (Routing.java) and determining the ways between those route nodes (RouteLineProducer).
I'll not be able to work on a big change to GpsMid like the patch anytime in the near future. If you or anybody else wants to go for it, this would be great. I do agree this change is too big to try to keep map format compatibility this time but rather all existing backward compatibility code could be dropped after this step as well.