Strange routing - indirect route

Hope this is the correct place to post. Saw that GraphHopper was available on the OSM website so tested it out near me.

Here is the route I have an issue with:

This seems like an unnecessary detour, which is not suggested by any other routing software I tested (OSRM, Mapzen, Google, Bing). The right turn across traffic, left turn onto the B9157 and then giving way at the roundabout for cars on the busier road surely isn’t faster than continuing on the A921 (albeit at 20 mph)?

Is this a routing issue or is there a problem with the OSM data?

This is indeed strange and the straight way would take 1min longer than the obvious detour. We’ll look into it, thanks for reporting!

The maxspeed tags are indicating the detour is indeed not that much slower and also we are giving inner city a bit penalty. And e.g. Google suggests also something between 5 vs. 6min (although they say the detour is indeed slower). So this result is not soo ‘strange’ :wink: but a real life experience would be interesting.

Here are the maxspeed tags for the detour:


20mph for the rest + +

And if you want to slightly favour distance reduction you can add ‘&weighting=short_fastest&ch.disable=true’:

Thanks for the reply. I just find it strange how your router is the only one to suggest the detour!

While the detour might be quicker judging by the maxspeed tags, shouldn’t there be some sort of penalty for having to negotiate three junctions? At least one of them you’ll have to come to a complete stop at - see Google street view: (crossing road) (stop sign)
(see next post)

The suggestion to change the url works on the graphhopper demo - however it can’t be done on the OSM website.

continued: (roundabout onto busier road)

(sorry, it said new users couldn’t post more than 2 links :stuck_out_tongue: )

The maxspeed tags probably explain this detour as well:

Apparently this will take 11 minutes, however no other router thinks it will be that quick! Most of the route is 60 mph, but on the road between Kinghorn and the B9157 you’ll be unlikely to reach that speed as it’s a narrow country road:

Without actual traffic data (that will come at some point) we have no chance to do this speed guessing always perfectly. You can always help us improve the speed guessing code via contributing the suggested changes, but be warned: this sounds easy but is not :slight_smile:

Maybe in the second example we do give the inner city a too big penalty or are just too fast for the detour. We’ll have to look into it and carefully tune accordingly if possible at all.