How-to find the reason a road is not used for a route?

I use OSM data through various routing services to find routes, mainly for going from A to B with a bicycle.

Often these routing services avoid a road and instead propose what looks like a detour, which can be hefty.

For example consider this route in Baden-Würtemberg, Germany from Titisee to Freiburg (seems you may have to switch routing engines away and back to get a resulting route):

There’s the B31. I think it’s not prohibited to cycle on it (although many cyclists probably would want to avoid it, but I would use it at least for the decent from Titisee in the mountains to Freiburg in the rhine valley). OSRM avoids it, Graphopper uses it, Brouter avoids it, komoot uses it.

What is a good way to figure out why a road could be not considered for a route, specifically for bike navigation?
What could work: displaying what tags are along a relation (not a segment: there are usually too many of them to go through every segment that could be the culprit)

I realise every routing engine works a bit different, so to get a proper answer, I’d have to dug into how the routing engine works - that just seems a bit infeasible to me (particular when it comes to proprietary engines like comoot)
FWIW, the one I most care about would be brouter, but often it’s just tooo cumbersome to use an android device.


I often find problematic sections by trying routing over shorter section

try two searches: (1) A → middle and (2) middle → B

repeat for failed one (this is called “binary search”)


I can not give you an detailed answer, but
If you are interested in brouter the most, I recommend using the browser site:
On the right side you will find the field “Daten” (The symbol of a table), which gives you a detailed insight on the calculation.

1 Like

There’s no end too the irritation I have with the cycle routing progs I’ve used and use, the latest collaboration of Komoot and Bosch called Connect. Picture this. A newly smoothed Strada Statale, maxspeed 80, in your dreams adherence. The old winding road is still there to get to the houses, those ways now tagged as residential, so maxspeed 50, some even signed 30. It crosses over the SS then left, then right of the cycle direction. They’re not oneway, so the navi directs one to use these winding curved sideways, basically to cross the 80kmh road twice each time because it chooses the lowest maxspeed ways. Talk about unsave, so when knowing the territory… ignore. That said, the prog does allow for many intermediate targets which help to bypass these detours and has fastest, leisurely, sightseeing, even an MTB mode.

1 Like

That’s an easy one: have a look at the profile:

Here’s a quote of the relevant part (marked red by me):

assign costfactor

  switch and highway= not route=ferry  10000
  switch or highway=proposed highway=abandoned 10000

  min 9999
  add max onewaypenalty accesspenalty
  add trafficpenalty

  switch or highway=motorway highway=motorway_link    switch allow_motorways 1.5 10000
  switch or highway=trunk highway=trunk_link          switch allow_motorways 1.5 10
  switch or highway=primary highway=primary_link      1.2
  switch or highway=secondary highway=secondary_link  1.1
  switch or highway=tertiary highway=tertiary_link    1.0
  switch    highway=unclassified                      switch isunpaved 10 1.1
  switch    highway=pedestrian                        10
  switch    highway=steps                             1000

The B 31 between Hinterzarten and Hirschsprung is tagged as trunk, but not motorway, about 9.2 km. Costfactor 10 means 90 km of tertiary roads are better than taking the trunk road.

You can modify the profile by yourself, i.e. setting this to 1.0 and you’ll see that the route will take the B 31 through the Höllental until the B 31 is a motorway.

OSRM and Valhalla will probably have a similar costfactor for trunk roads too.


Exactly, yes. Bicycle route-planners are by definition opinionated, and many are of the opinion that riding on highway=trunk is to be avoided where possible. For (my site) the weighting difference between highway=unclassified and highway=trunk is about x6, though there’s a whole bunch of other adjustments on top of that.


OSRM has a debug map for each profile that annotates every edge in the routing graph with its weight. I’m unsure if the annotations are based on OSRM’s default routing profiles or the ones installed on the FOSSGIS server that powers the OSRM option on, but the two sets of profiles are generally consistent.


There are a few odd things about the mapping at the Hinterzarten end:

  • name=Bundesstraße looks more like a description than something seen on a street sign (I’ve not recently visited this end of the village)
  • houses N of the junction have addr:street=Oberhöllsteig, also suggesting that Bundesstraße is not the name.
  • The transition from primary to trunk does not allow a clean exit for vehicles not permitted, or in OSM terms discouraged from using trunk. The logical tranistion point is at the last exit just after the bridge.
  • The similar transition near Titisee also seems a little arbitrary. If the section of B31 which is multiplexed with B500 is meant to be the primary section then it ought to be consistent.
  • I’ve always thought the whole B31 merited highway=trunk, but understood the meaning of the tag was different in Germany from the UK and that highway=trunk actually legally excluded cyclists. The road is a key link through the Southern Black Forest and has a lot of heavy freight traffic, but if the different sections do not have different rules for cyclists there is an element of tagging for the router.

I thoroughly recommend Hinterzarten as a nice place to stop, but it still looks to need more consistency in how it is mapped.

Sorry, I do not have much time, atm, to take a closer look. I know, though, that there have been some disputes about the B31 and its highway values in the past. Take at look at the history of the objects.
Over the time, the B31 was reconstructed part by part which means you need to take a closer look at each sections with up-to-date sources and yes it is a mess but that is reality.

In general, in Germany, highway=trunk without motorroad=yes are open to bicycles and the difference to highway=primary is the construction of intersection and if tracks are connected to the road or not.

1 Like

I thought highway=trunk was generally about connectivity, whereas this sounds vaguely like how we’re using expressway=yes in the U.S.

In any case, the classification shouldn’t matter very much to most routers if the speed limits (maxspeed) and access restrictions (bicycle) are explicitly tagged. If so, the classification is only used to avoid unnecessary shortcuts that transition between roads of different classifications.

1 Like

I think that Germany is the outlier here - as I understand it, “trunk” is only used on expressways there. This leads to my favourite bit of comedy routing here (and to be fair, that’s the only combination for that route on the OSM site that shows that result now).


There are roads in Germany that officially have “Bundesstraße” as their name, but here I also think it is wrong. There are no other clues to a name. In this case it seems to be a description (possibly copied from another map)

Of course, these houses are not accessed from the main road either. The Oberhöllsteig is located here. The name of this path “Am Hischberg” is possibly just as wrong. There is a place-node “Hirschenberg” (translatable as deer mountain :deer: :mountain:) and there is a street “Am Hirschenberg” nearby. Hischberg without ´r´ is definitely wrong.

You are right. But this has no legal effect in Germany. trunks in Germany alone without motorroad have no restrictions for vehicles like motorways. Restrictions only exist with traffic signs motorroad=yes.

But as @skyper wrote: there is a dispute about whether the B 31 is a trunk or a primary.
In my opinion, the section Hinterzarten westwards does not meet the (German) criteria for a trunk because this section is not completely free of crossings.

I think you are right.

Not in general.
The wiki say: “Use highway=trunk for high performance or high importance roads that don’t meet the requirement for motorway. In different countries, either performance or importance is used as the defining criterion for trunk”
The German definition is based on physical construction (e.g. without crossings), less on importance.
You remember?: “Historically, trunk in the US has been defined based on physical construction, but the 2021 US highway classification project has moved to a definition based on network importance.”

I’m greatly impressed by all of your great quality responses! Huge thank you to everyone of you for these great answers!

Looks to me like it’s time to start tuning a brouter profile to my own opinion.

Btw I did take the B31 from Hinterzarten to Buchenbach, did not encounter any difficulties. Well, they did “hide” a 30 km/h sign behind the beginning of a turn / behind the rocks at the side of the road >.<
For the decent, it’s a reasonable choice. I ended up not doing the return trip, so I can’t comment on how bad of a choice it is for the way up, but I’d imagine the various ways around it are way better.

Oh yes, it was a disruptive change and we didn’t take that decision lightly. A big factor in our decision to change our local definition of highway=trunk was that we thought other countries, particularly those in Europe, had already aligned on a connectivity-based definition. I think changing this definition while preserving the previous meaning in expressway=yes has turned out well so far, both for renderers and our community’s health (much less edit-warring). If the German community does decide to switch to a connectivity-based definition in the future, hopefully you’ll be able to benefit from our efforts.


Zkir gave a very interesting talk about the connectivity issue at SotM-Baltics back in 2013. At the time there were sufficient differences between European countries that it was quite difficult to find a single way to have a basic interconnected network between major cities. The fallback was to use E-routes (which happen to be poorly mapped in the UK because there is no signage).

I remember noting that B31’s status seemed anomalous back in 2014, but was also aware that there had been various tag wars over it’s status.

In Poland, highway 19 is mostly primary with the odd sections of grade-separated dual carriageway (numbered S19) as trunk. I think it is gradually upgraded to similar standard, but some sections at grade have carefully [designed junctions](OpenStreetMap. Traffic patterns and density were similar along most of the route I drove between Białystok and Krasnik, so in the UK it would be trunk. However, the more modern sections of highway are sufficiently different that I wasn’t surprised that they were tagged differently. (Note that Białystok has a single trunk road connection from the West which highlights connectivity).

In countries in the global South using a connectivity-based approach is far more valuable, and, I think, an important reason to move towards it as standard.