posts /

Routing: When extensive tagging is still not enough

Posted Wed Dec 13 20:46:24 2023 Florian Lohoff

In my RouteQA initiative i mostly care about temporal changed routes, e.g. routes which change because mappers make changes to the map data. I try to catch mistakes early e.g. reversed oneways, broken turn restrictions, access restriction and the like.

When i add "clusters" e.g. areas i check routes within, i also try to fix the most obvious routing mistakes e.g. shortcuts or rat-race roads. Almost all cases are caused by sparse tagging. Mappers focus on the higher class roads which carry extensive tagging about maxspeed, lanes, lane_markings, surface and the like. All the small side or rough roads lack these information and suddenly the side roads are mathematically better. This is probably true for a single vehicle, but considering we direct most of traffic to these smaller roads these roads will never cope with the traffic we send.

The first thing is that i fix the sparse tagging by iterating on the side roads and fill the gaps. In 98% of the cases this will fix shortcuts or rat-race issues. But there are hard to fix cases i up to now had no clue how to fix.

I started a thread on osrm-talk and the routing mailinglists which basically returned "unfixable", "you need to fix the engine", "the side road is better so what", "this is easy" or "unfixable without mobility or live data".

I don't buy the "mobility or live" data as thats not for hobbyists, or non profits. You need money to buy and its a huge undertaking to process that huge stream of data.

The other options are assuming "something magic happens".

So i sat down and made a "Proof of concept" inventing a tag for customizing the route weight and using that in an OSRM profile.

The tag i used is route_weight_factor:motor_vehicle which shall contain a float from -0.8 to +0.8.

This then will be multiplied with the calculated weights from the physical tags like lanes, lane_markings, maxspeed, road class etc.

So a -0.8 means we go down to 20% of the speed of the road.

Here is the git commit for the car profile change:


This enables to fix issues like this:

The small side-road is barely wide enough to fit a car. Sending 2 way traffic through there is definitely not an option. There is no legal restriction so we cant really exclude it. So we need want to make it worse than the way around.

It shows on how mappers would be able to influence and fix routing in case something like this would get an established tagging.

Also it would allow us to respond to public bodys e.g. city councils asking for routing changes in OpenStreetMap.