OpenStreetMap

Routing — alternating oneways

Posted by daniel-j-h on 12 December 2016 in English (English)

Every now and then OSRM users report routes that take puzzling, unrealistic detours. For example, a user reported this route that went to extensive means to avoid going over Flottsundsbron, a narrow bridge with alternating direction of traffic in the south of Sweden. Investigating this strange route led us to the oneway=alternating tag in OpenStreetMap.

Uppsala Route Before

Flottsundsbron Mapillary View

Flottsundsbron Photo by Mapillary user alatius under CC BY-SA 4.0.

The oneway=reversible tag's usage on Flottsundsbron meant our routing engine avoided it completely. A search for this tag in OSM will reveal that it has been used to express two different semantics.

On one hand the tag has been used to describe narrow bridges and tunnels that alternate direction of travel on a high frequency, say every five minutes. Encountering a oneway of this variety may add some amount of waiting time to the user's route, but the route is always accessible. Flottsundsbron is an example of this type of way; a changing traffic light dictates the direction of travel.

On the other hand there are oneways that change direction of travel very infrequently, like highways for the commute into a city in the morning and out of it in the evening. For these it does not make sense to let the user wait until the direction of travel changes. This highway, I-95 in northern Virginia is an example of a highway that reverses its direction twice a day.

If the routing engine doesn't know about the frequency of direction change there is no way to distinguish between the two semantics being overloaded in the oneway=reversible tag.

To pacify this ambiguity, we came up with the oneway=alternating tag at the Elbe-Labe-Meeting. The semantic distinction is clear now:

With distinct semantics in place we route you over oneway=alternating but apply a penalty for waiting time.

Uppsala Route After

Check out the tags' Wiki pages for more detailed descriptions:

The next step would be tagging oneway=reversible with the specific times and oneway=alternating with the waiting times or the frequency.

You can read up on the original discussion with the Routing Engine. This feature is included in the latest OSRM v5.5 Release. We're always glad for user feedback; in case you stumble over issues like this please talk to us! You can find us in the OSRM Repository on IRC and on the osrm-talk mailinglist.

Comment from RobJN on 13 December 2016 at 19:20

I'm not sure that I'd tag these as "oneway" at all. They are narrow roads that you can travel in both directions on, but due to the narrowness they have a control mechanism (give way/yield, or lights).

The one near me, I can think of has traffic lights and (via sensors) they change to green as you approach assuming no cars are approaching from the other side. As a two-way road I won't be tagging it as oneway=alternating - it's just a traffic light controlled junction.

So for the proposed tag how long should "frequently" be? More than 2 minutes, less than 5?? Other?

Comment from daniel-j-h on 14 December 2016 at 10:54

The distinction should be between

  • Does it make sense for the user to wait there for the direction to flip
  • Does it make sense for the user to go there without knowing the exact point in time

As mentioned, it would be great to have frequency / interval tags on all of them. Then the routing engines could decide on their own and use the data e.g. as penalty or for time-dependant routing. Of course dynamic mechanisms like sensors make this harder.

What we really want to accomplish with oneway=alternating is the clear distinction from oneway=reversible's time-dependence.

Login to leave a comment