Relation:restriction

From OpenStreetMap Wiki
Jump to navigation Jump to search
Public-images-osm logo.svg restriction
France road sign B2b.svg
Description
Permitted turns on a highway junction. Show/edit corresponding data item.
Group: Restrictions
Members

  • way - from
  • way - to
  • way node - via
Status: de facto

A turn restriction is a relation that specifies permitted turns for vehicles on a highway junction. Normally, restriction relations correspond with traffic signs and road markings at the junction, specifying forbidden or mandatory directions for vehicles. Implicit rules such as forbidden U-turns in a given jurisdiction, or forbidden turning into a pedestrian street or across a barrier, should not be mapped using relations. Absence of a turn restriction on a junction generally means that all turns are permitted, subject to such implicit rules.

The most common form of a restriction relation is a triplet {from-way, via-node, to-way}, accompanied with a restriction=* tag specifying whether a turn from the from-way to the to-way is permitted at the via-node. There may be several turn restrictions at a junction, represented by separate relations.

This turn restriction relation is not limited to turns, but can also be used for instance if you are only allowed to go straight on.

When to map

There are a number of important things that need to be taken into account when creating a turn restriction.

  • There may be several turn restrictions at a junction, represented by separate relations.
  • There is no need to restrict turning into the wrong way of a one way street. This is taken for granted.
  • Turn restrictions do not apply to pedestrian unless the type or key is restriction:foot.
  • Don't map turn restrictions that are the default for a given jurisdiction and are not signed. It is much better to ensure that routing engines embody the regional rule rather than mapping every occurrence as a turn restriction. This applies particularly to unsigned U-turns in Brazil, where using turn restrictions will require hundreds or thousands of restrictions and micro-segmentation of all roads which in turn make editing data hard.

Some mapping companies are adding unsigned implicit restrictions (e.g. MapBox)

In some places, U-turns may be prohibited along a specific stretch of road or within a specific zone. In these cases, some mappers have tagged the roadway with u_turn=no or no_u_turn=yes.

There are multiple competing approaches to mapping a no turn on red restriction, some of which use restriction relations.

Tags

Key Value Explanation
type restriction Relation type for restriction relations.
restriction no_right_turn / no_left_turn / no_u_turn / no_straight_on Prohibitory restriction: a valid route may not proceed along the restriction relation's geometry.
only_right_turn / only_left_turn / only_u_turn / only_straight_on Mandatory restriction: a valid route must proceed along the restriction relation's geometry.
no_entry, no_exit Other restrictions: entering or exiting a road from one side is forbidden but said road isn't oneway
restriction:hgv, restriction:caravan, restriction:motorcar, restriction:bus, restriction:agricultural, restriction:motorcycle, restriction:bicycle, restriction:hazmat no_right_turn / no_left_turn / no_u_turn / no_straight_on / only_right_turn / only_left_turn / only_u_turn / only_straight_on / no_entry / no_exit Restriction refers only to the given type of vehicle.
restriction:bicycle stop / give_way Used where bicycles may pass a red light at traffic signals
except psv / bicycle / hgv / motorcar / emergency The restriction does not apply to these vehicle types (more than one: except=bicycle;psv)
implicit yes / no Turn restrictions that are implied by local laws, safe driving norms, or the real-world physical layout of roads, but are not accompanied by explicit signs (posts or road paint). See Mapping implicit turn-restrictions.
restriction[:<transportation mode>]:conditional <restriction-value> @ <condition>[;<restriction-value> @ <condition> ...] Restriction that only exists under certain conditions, such as time. The restriction value is one of the ones listed above, e.g. no_right_turn. Multiple values (along with their condition) can be separated by semicolons. See conditional restrictions for details.
type restriction:hgv / restriction:caravan / restriction:motorcar / restriction:bus / restriction:agricultural / restriction:bicycle / restriction:hazmat Restriction refers only to appropriate type of vehicles, replaces the type=restriction tag.
This is/was used in conjunction with restriction=* instead of using type=restriction + restriction:*=*.[1]

In November 2020 this was used 86 times, while type=restriction + restriction:*=* was used 11500 times.

day_on day of week for example, no right turn in the morning peak on weekdays might be day_on=Monday;day_off=Friday;hour_on=07:30;hour_off=09:30
day_off day of week
hour_on time of day
hour_off time of day

Members

Way or node Role Cardinality Notes
way Role from 1
1 or more
A way from which restriction starts (e.g., no right turn from here).[2] A no_entry restriction can have one or more from way member(s); all others may only have exactly one from way member.
way Role to 1
1 or more
The end way of the restriction.[2] A no_exit restriction can have one or more to way members, all others may only have exactly one to way member.
node
way
Role via 1 node
1 or more way(s)
Member(s) connecting the beginning and end ways representing the attempted turn.

As shown below, a turn restriction can either have a single connecting node or one or more connecting ways with a via role.[3] If the via members do not connect the from- and to- members, the relation is invalid.

node Role location_hint 0 or 1 A hint to a renderer as to where might be a good place to position a symbol indicating the restriction. E.g., in a N/S/E/W cross roads where you can't turn from S to E, you might put a node just SE of the junction and the renderer might place a no right turn sign there. The role Role location_hint is deprecated as it is not verifiable on the ground (and tagging only for the renderer). It shouldn't be used anymore.
Turn Restriction with a single node as the Role via member.
Turn Restriction with multiple ways as Role via members.

Road signs

The sign number in the US MUTCD is given in parentheses. There are slight differences of these roadsigns from country to country. Images of turn-signs all around the world can be found on Wikimedia Commons

Note: The symbols for restrictions displayed in editors are not authoritative; tagging must not rely on them. E.g., a no_right_turn in JOSM displays either symbol 2a (straight ahead and left) even if there is no left turn. The relation members and restriction value are the important part.

Sign Restriction Remark Sign Restriction Remark

1a

Signal B21d1.svg no_left_turn Germany, Italy, Japan, The Netherlands, Russia, Ukraine, Romania (restricts U-turn as well) 1b France road sign B2a.svg no_left_turn Australia, Brazil, France, Ireland, Philippines, Poland, Russia, Spain, Switzerland, UK, Ukraine, US (R3-2; R3-18 combined with no U-turn)
2a Signal B21d2.svg no_right_turn Germany, Italy, Japan, The Netherlands, Russia, Ukraine, Romania 2b France road sign B2b.svg no_right_turn Australia, Brazil, France, Ireland, Spain, Philippines, Poland, Russia, Switzerland, UK, Ukraine, US (R3-1)
3a Signal B21e.svg no_straight_on Germany, Italy, Israel, Japan, The Netherlands[4], Poland, Russia, Switzerland, Ukraine 3b MUTCD R3-27.svg no_straight_on Brazil, US (UK and France never use such signs; you would usually be facing a no entry sign in such a situation, or if it's two-way ahead you might see adjacent left-turn-only and right-turn-only signs). Formerly used in Ireland.
4a France road sign B2c.svg no_u_turn Brazil, France, Germany, Israel, The Netherlands, Philippines, Poland, Spain, Switzerland, Russia, Ukraine, US (R3-4)

A no_u_turn restriction relation is primarily useful if the Role from and Role to members are distinct ways.

4b UK traffic sign 614.svg no_u_turn Australia, Japan, UK

A no_u_turn restriction relation is primarily useful if the Role from and Role to members are distinct ways.

5a Signal B21c1.svg only_right_turn Typically on the approach to a junction.

In the US, a white rectangular sign is used for this situation and the case where one lane on a multi-lane road must turn (R3-5R).

In the Philippines, it is mainly used before a junction or sometimes in a junction, either on a standalone blue circular sign with a white arrow or a blue circular sign on a white rectangle with text, usually "ALL TRAFFIC".

Ukraine (just before a junction).

5b Signal B211.svg only_right_turn Typically at the junction.

In the US, a white rectangular sign is used for this situation and the case where one lane on a multi-lane road must turn (R3-5R).

In the Philippines, it is mainly used on a junction with a one-way road, either on a standalone blue circular sign with a white arrow or a blue circular sign on a white rectangle with the text "ONE WAY".

In Slovenia it is used on the inner island of the roundabout.

6a Signal B21c2.svg only_left_turn[5] Typically on the approach to a junction.

In the US, a white rectangular sign is used for this situation and the case where one lane on a multi-lane road must turn (R3-5L).

Ukraine (just before a junction).

6b Signal B212.svg only_left_turn Typically at the junction.

In the US, a white rectangular sign is used for this situation and the case where one lane on a multi-lane road must turn (R3-5L).

7 Signal B21b.svg only_straight_on Used in Italy, Russia, Ukraine, the UK and other countries; usually seen just before a junction or on the approach to a junction.

In the US you'll see the text "NO TURNS" in a white square (R3-3; R3-5a is usually used only in the case where one lane on a multi-lane road must turn).

8 RU road sign 3.1.svg no_entry Used for non-one-way roads, where entering across some point (member node with role via) is prohibited. Relation can have several from members[2] and one to member.

In Ukraine is used for opposite-direction one-way road entries, and for roads that even residents are not allowed to drive.

9 RU road sign 3.1.svg no_exit Used for non-one-way roads, where exiting across some point (member node with role via) is prohibited. Relation can have one from member and several to members.[2]

For a more detailed correspondence between signs and tags, see the country-specific sign page:

Edge cases

As of March 2021, the no_entry and no_exit restrictions are not supported by a number of popular OSM tools and routers[6], and it's unclear if there is any consensus about how these situations should be mapped.[7]

A previous version of this article suggested that routers should assume a prefix of no_ represents a linear prohibitory restriction and ignore the rest of the value. However, most routers do not make this assumption because of no_entry and no_exit, as well as the values documented at No turn on red.[8]

A turn restriction relation may be used as an alternative to barrier=bus_trap, the type of barrier that permits passage only for wide vehicles such as buses. At the junction passage from one side to the other is restricted.

Examples

There is a clear distinction between two types of turn restrictions. There is the mandatory restriction type and there is the prohibitory restriction type. Different ways will have to be selected for each of these restriction types.

Mandatory restriction

Only turning right from a to b is allowed at N. So turning left is forbidden.

This restriction type sets the way where one is only allowed to go to. Going to other ways from the via point is forbidden with this relation. The turn restriction relation is tagged with the following two tags:

type=restriction

restriction=only_right_turn

  • way a has role 'from'
  • way b has role 'to'
  • node N has role 'via'

Prohibitory restriction

Turning left from a to b is not allowed at N.

For the prohibitory restriction type the way where one is not allowed to go to is set. The restriction relation can be tagged with the following tags:

type=restriction

restriction=no_left_turn

  • way a has role 'from'
  • way b has role 'to'
  • node N has role 'via'

Turning to other directions is not forbidden with this restriction. If there are other restrictions at the crossing, these will have to be defined separately.

NB: Of note is as at this writing 2020-11-27, a 'no' restriction, left, right, straight on into a street that is already tagged oneway is not accepted if in the opposite direction. It will only work if the 'to' is not tagged i.e. bi-directional or is in the logical 'allowed' driving direction unless traffic signs prohibit so. Example, a continuous white line on road center would stop taking a left and the traffic sign would say that straight or right is allowed.

Users coming from way a via way b cannot exit through way c.

The via point of the turn restriction doesn't have to be a node, it can also be a via way. This is the case for the example on the right. This turn restriction is set with the following tags:

type=restriction

restriction=no_right_turn

  • way a has role 'from'
  • way b has role 'via'
  • way c has role 'to'

Editors

To create a turn restriction different editors can be used. Some do not support all functionality explained above, natively!

iD

iD in-editor turn restriction support (animated gif)

The OpenStreetMap web editor iD has (almost) complete in-editor turn restriction support.

  • For turn restrictions whose 'via' member is a node or a way: Native editor support exists. These can be added by selecting the node of the intersection where you want the turn restriction. Then select the way entering the turn and toggle between restricted and unrestricted turns by clicking the red or green icons (iD includes a built-in help for further instructions on how to do this).
  • When the lanes are divided see this Q/A for an example of adding a u turn restriction.

JOSM

JOSM has partial in-editor Restriction support, with the use of a plugin.

  • The Turnrestrictions plugin can be downloaded to create and edit turn restrictions which have a node as its 'via' member.
  • Node as 'via' restrictions, or those with a way as the 'via' member, can also be added by manually creating a new relation.

See JOSM Relations and Turn Based Restrictions for further information.

Go Map!!

Go Map!! has partial support for restriction relations:

  1. Tap the Display Settings button.
  2. Enable the Turn Restrictions option under the Overlays section, then tap Done.
  3. Tap an intersection node to select it. Tap the "More..." toolbar button, then choose Turn Restriction.

Go Map!! does not yet support adding multiple Role via ways to a restriction relation. [7]

Vespucci

Vespucci built-in turn restriction creation (click on image to see animation)

Vespucci, the OSM Android editor, supports editing of Restriction relations including interactive turn restriction function.

Vespucci supports creation of and editing of Restriction relations (both node-as-'via' and way-as-'via' types). Once a Restriction relation exists and is selected, its members (or tags on the relation) are edited via dropdowns.

Errors

Missing turn restrictions or errors in turn restrictions can be reported by different error reporting tools. To check if turn restrictions are properly applied, a routing test can be performed using different routing engines such as OSRM. Note that some advanced features like multiple via ways are not supported in all routing engines, see comparison of them.

There are several data sources that can be used to find missing turn restrictions or errors in turn restrictions:

  • Mapillary has the possibility to show traffic signs on a map that have been recognized in crowdsourced street view photos.
  • The ScoutSigns JOSM plugin can show recognized traffic signs as a layer in JOSM. The data originates from the camera mode feature in the GPS Navigation & Maps App.
  • The ImproveOsm plugin has a Turn Restriction layer that points at probably missing turn restrictions.

Relevant Sophox queries:

Tools

  • Relation Check A tool to generate a graphical display of relations, including restrictions, from a local .osm file
  • Map of Turn Restrictions A map which shows turn restriction icons (optionally: warnings and errors) with popup info and highlights the concerned ways on click.
  • OSM Restriction Validator Shows unnecessary restrictions and restrictions that block access to streets
  • keepright checks 8 different types of turn restriction errors, worldwide.

Possible tagging mistakes

See also

References

  1. Because of an unresolved bug in the software Osm2mp, the restriction:hgv=only_straight_on style can lead to incorrect routing - restriction:hgv=only_straight_on is treated as if the relation was tagged restriction=no_*. As a result, some mappers use type=restriction:hgv + restriction=only_straight_on as a workaround.
  2. 2.0 2.1 2.2 2.3 The "from" and "to" members must start/end at the via node or the via-way(s), otherwise split it!
  3. Notice: Processing of turn restrictions which contain one or more ways in the via role is more complicated than if a single node is used for the via role. As a result some routing software (GraphHopper) works only with turn restrictions that contain a single node in the via role. This should be fixed by the software, however if you have a choice please consider using just a single node within the via role.
  4. RVV 1990, sign D7
  5. If only_left_turn wrongly prohibits u-turns where they are allowed, use no_straight_on no_right_turn instead.
  6. The turn restriction preset of JOSM version 15806 and the JOSM turnrestrictions plugin version 35405 do not show no_entry and no_exit in the list of restriction types. Source code inspection suggests that OsmAnd and OSRM ignore them completely while Valhalla treats them like the more common no_* restrictions and doesn't support multiple "from" or "to" ways.
  7. Talk thread that ended without clear consensus; one "help" question; another "help" question
  8. OSRM specifically excludes _on_red restrictions. [1] Valhalla [2], OsmAnd [3], GraphHopper [4], and OpenTripPlanner [5] all use a whitelist of recognized restriction types. Only BRouter categorizes restrictions based on their prefixes, though it logs _on_red restrictions as invalid. [6]

External links