Tagging complex "no through traffic" restrictions

There are many cases where “no through traffic” restrictions are a little complex. Consider the case below. If you enter through the green point, then exiting through any of the two red points are not permitted. But through traffic is permitted if you enter or exit through any other road, for example if you enter through “Skarvegen” or if you exit through “Losvegen”. Note that the restriction only applies if you entered past the sign at the green point.

(The reverse restriction may also apply in many cases, i.e. two entry points/one exit point.)

The restriction sign at the green entry point says “Applies to through traffic to Sjøvegen” (the yellow secondary road to the north):

Using motor_vehicle=destination on the ways between the green and red points would not work because it would also deny the other entry and edit routes and because direction of travel matters. Also, some routers (GraphHopper) do not seem to work with consecutive ways with this tagging.

A restriction relation with restriction=no_exit seems to fit the description, however, i) there is no applicable via point, ii) the restriction applies to specific points (the position of the signs), not ways, and iii) more than one entry point may be needed.

Using a restriction relation seems to be needed, but how do you think it should be done?

  1. Either modify the current restriction=no_exit wiki to i) permit points as to and from members, ii) make the via member optional and iii) permit multiple to and from members. There are 30-40 valid no_exit restrictions currently in OSM (206 in total but many with one member only).
  2. Or create a new restriction type, for example restriction=no_through_traffic, with the same member types as above, i.e. with (green) entry points as from members and (red) prohibited exit points as to members.
  3. Other solutions?

Here is a file with 1582 real-life examples (disregard the cases with just two members and no other routes): no_through_traffic_norway.osm

My intention is to create a proposal, depending on the feedback here.

Can you still come “down” i.e. south, through the 2 red dots?

Yes, the restriction in this example is only if you enter past the sign at the green point and exit through either of the red points.

(In many cases, however, the reverse restriction also applies).

So those roads are still two-way for local traffic, but you can’t transit through them?

They are two-way traffic and you can transit through them in several ways, but you cannot exit through the two red points if you entered past the sign at the green point.

Major routers like OSRM, Valhalla, and GraphHopper now support restriction relations that have one or more ways with the via role, so in principle you could model it as a very complex restriction relation. However, as far as I know, none of the routing engines featured on osm.org supports restriction=no_exit, other than very basic support in Valhalla that wouldn’t help you here. Instead, you’d have to model it as separate restriction=no_left_turn/no_straight_on/no_right_turn as appropriate. From the look of it, there shouldn’t be too many via members in the relations, but there would need to be multiple relations.

I don’t know whether or not this representation would be feasible in current router architectures. It might have to be postprocessed into something resembling turn restrictions with many via ways.

An alternative approach would be to tag all the relevant ways with access=destination. This cluster of ways collectively forms an implicit subgraph, which is restricted based on where one enters or exits the subgraph. However, this doesn’t work if there are specific entrances and exits that trigger the restriction. It would be a simpler solution for the cases that apply in every direction.

1 Like

So if you’ve come from off the south side of the map, then followed either of the blue lines here, you can still go out through the red dots?

2 Likes

Yeah I’m confused… How does anyone know if you entered from (e.g.) Løktvegen? Is there a camera or something?

1 Like

I am assuming that the goal/motivation for the sign is to prevent cut-through traffic on Rådhusvegen (a “shortcut” between two secondary roads, Strandvegen and Sjøvegen), that the other routes are still allowed because in practice they haven’t been as problematic for traffic so no one’s bothered to put up a sign, and that the specific sign used is because that’s the most practical thing available under Norwegian road regulations, and that enforcement is in person on a complaint basis.

Question: does that wiggly part of Skarvegen actually exist as a public through road? Orthophoto shows it as going through a corner of a building, and a commercial map provider shows what to me looks like a gravel driveway to Rådhusvegen 4 that dead-ends, rather than a public street.

screenshots

Yes, that’s not an allowable source. But if someone surveys it locally and if they confirm it does not connect, that eliminates one of the “red dots” and simplifies the mapping.

Otherwise, I agree that a pair of no_right_turn and no_left_turn relations with from being the relevant stretch of Rådhusvegen, to being the relevant part of Sjøvegen, and any ways in the middle as via seems to provide most compatibility between situation on the ground and what’s supported in OSM and routers. The ways will have to be split in OSM compared to what they are now. And don’t forget to make the restrictions only apply to motor vehicles.

Another practical way could be to map all properties of the roads in the area (speed limits, widths, surfaces) and you’ll likely get the legal routing from routers anyway. You can map the traffic sign as a node not part of a highway-way to document its existence.

Modelling it as a no_exit or no_through_traffic could be more correct with situation on the ground, but whether it’s worth not having it supported by routers until they add support (if ever) is a question only the local community could answer. But frankly, if we’re being that strict for correctness and we’re looking to add new OSM tags, this should be something like motor_vehicle=yes, motor_vehicle:conditional=no @ (passing:node:id=5303700311) (that’s the intersection with Sjøvegen)

FWIW, I briefly looked at the .osm file you provided, and the examples I saw are mostly covered by motor_vehicle=destination (e.g.: Way: ‪Tangenveien‬ (‪35129255‬) | OpenStreetMap). In some other cases, like the restriction between Eiganesveien and Alexander Kiellands gate in Stavanger, the restrictions on Bretlandsgata (one-way at Holbergs gate and no-through-traffic at Øvre Orknøygate) effectively turn the whole area into motor_vehicle=destination. In other cases, motor_vehicle=destination would effectively map the intent of the signs, although it might not be their strict literal meaning.

Mapping the strict literal meaning can be fraught with problems too… when the “Gjelder gjennomkjøring” sign is missing, should we take it literally as motor_vehicle=no? Look at this example in Hamar (Google) where your file has a no_exit relation. Street View shows that sign there, with no “Gjelder gjennomkjøring”, since 2010…

Yes. The restriction was likely introduced because Rådhusvegen was frequently used as a shortcut.

There are seldom controls. Typically >95% of the cut-through traffic would be gone after such a sign has been put up. Two officers with radio could handle a control if there still is a problem.

Perhaps that solution could be a third, and better, alternative.

  • All the restricted ways between entry and exit points in via members.
  • All points of entry (node at the sign, or the junction just before it) as from members.
  • All the exit points as to members.

Would it be difficult for routers to have nodes as from and to members? All turn restrictions in the wiki currently require ways. Ways could be created, but they would typically be artificially short.

Thanks!

Wouldn’t just an vehicle access=destination / private at the green dot do teh same thing without all the issues that relations introduce?

But then traffic through other routes would also be prohibited, right? In this case, for example from the green dot to the west through Losvegen, which should be permissible.

Indeed, restriction relations require the from and to members to be ways in all cases. This is appropriate because turn restrictions affect the routing graph, which is fundamentally a structure made of weighted edges. Sometimes turn restrictions result in short ways, but the same can happen in some similar situations when avoiding relations.

Note that there’s no need to begin the way at exactly the location of the sign (green in your diagram). Since there’s no driveway between the intersection and the sign, you should begin the restriction at the intersection. This might require multiple restriction relations to cover all the paths that someone might take to get to the intersection.

1 Like