Conditional restrictions

From OpenStreetMap Wiki
(Redirected from Key:oneway:conditional)
Jump to navigation Jump to search
Logo. Feature : Conditional restrictions
One example for Feature : Conditional restrictions
Description
To tag restrictions being dependent on a condition.
Group

restrictions

Tags

access:conditional=*, charge:conditional=*, maxspeed:conditional=*, maxweight:conditional=*, oneway:conditional=*, overtaking:conditional=*, restriction:conditional=*, *:conditional=*

In some cases, restrictions such as access=private or maxspeed=60 are only valid when certain conditions are fulfilled. Those conditions are modeled with additional tags with suffix :conditional, whose values use the syntax described below.

For example, on a motorway section with the normal speed limit of 100 km/h passing near a residential area, a speed limit of 60 km/h is imposed between 23:00 and 5:00. This is tagged as maxspeed:conditional=60 @ 23:00-05:00, overriding the default maxspeed=100.

If the restriction only applies to a certain vehicle category (or transportation mode), the tag key can be extended by a suffix describing the mode, for example oneway:bicycle=no and maxspeed:hgv=80. As a special case, an access restriction that applies only to a certain transportation mode should be tagged as e.g. hgv=no rather than access:hgv=no.

Tagging

The scheme uses the same syntax as that used for normal unconditional restriction tags with the following differences: The key ends with the suffix :conditional. The value comprises the actual value followed by the character '@' and the condition.

The general syntax of the tag is as follows (fields in square brackets [..] are optional):

<restriction-type>[:<transportation mode>][:<direction>]:conditional
  = <restriction-value> @ <condition>[;<restriction-value> @ <condition>]

In access tags that are limited to a specific transportation mode the restriction-type access: is omitted, as it is in regular tags.

<transportation mode>[:<direction>]:conditional
  = <restriction-value> @ <condition>[;<restriction-value> @ <condition>]

Using this tagging it is possible to tag both the typical state and one that is triggered only in some situations. It allows to fully tag a given situation and keep basic tags easy to process.

Key

The key is constructed in the same way as keys for established restriction tags with an additional :conditional suffix.

Restriction type

This can be any type of restriction that may have conditional validity. Common examples are access=*, maxspeed=* and oneway=* restrictions. The restriction type should reflect the "main" traffic sign. For the Vorschriftszeichen 1.svg sign, having an additional sign specifying a condition the type should be vehicle. On the other hand, for the sign Nederlands verkeersbord C17.svg, the restriction type should be maxlength (similar for other max<dimension> signs).

Transportation mode

This key-part specifies the transportation mode to which the restriction applies, e.g. bicycle, motor_vehicle, foot, agricultural, ....

Example: vehicle:conditional=*

See Key:access § Transport mode restrictions for a list of possible values in the transportation mode hierarchy.
Please note that the value agricultural designates the type of vehicle (typically tractors or special machines having a low maximum speed), not the purpose of the highway use.

Direction

Some restrictions are direction-dependent. Use forward and backward to indicate in which direction the restriction applies. The value depends on the direction in which the way is drawn in OpenStreetMap. For guidance on how to identify this in your editor, see the description of the terms "forward", "backward", "left", and "right".

Value

The value comprises the actual restriction followed by the @ character and the condition. Add spaces before and after the @ character to improve readability.

Mostly just one value with a corresponding condition is specified. In exceptional cases, it may be necessary to use two or more value–condition pairs. Such value–condition pairs should be separated by a semicolon. One situation may be a certain speed limit at certain times of day but a different (lower) speed limit in case of wet conditions. See § conflicting restrictions below how to order multiple value-condition pairs.

permit_holder was originally proposed. permit is now more numerous, but be very careful in interpreting them. The meaning of UK's "except permit" (restricted to, e.g., residents and tenants, closer to access=private) supplementary plate doesn't have the same definition as the US-originated access=permit (almost always granted to everyone as part of the procedure of travelling) in OSM.

Restriction-value

This is the actual value of the restriction; e.g. yes, private, 80, 55 mph. The restriction can be absolute (yes, no, permissive and other values that apply to everybody), according to the purpose of the highway use (destination, delivery, customers, forestry, agricultural, etc.) or according to an explicit permission (private, permit).

Condition

This field specifies the condition for which the restriction applies. Conditions may include a semicolon, ;, and where they do must be enclosed with parentheses, (). It is suggested, by some, to simply do this always.

Various kinds of conditions can be distinguished:

  • Time and date: Use the standard opening hours syntax. Note the common occurrence of semicolons; e.g. (Mo 06:00-24:00; Tu-Fr 00:00-24:00; Sa 00:00-13:00), Mo-Fr 07:00-19:00, sunrise-sunset, or Jan-Mar.

    Comments, to be presented to the user directly, are allowed and should be written in local language. For example, "rowing events" and Mo-Fr 06:00-10:00,15:00-19:00 "bij grote verkeersdrukte". In the latter, the condition may apply within the specified time windows, but it certainly does not outside of them.

  • Time of year: e.g. winter or summer which are not covered by the opening hours specification. Only use when the specific dates are not known or change each year. Notably used for speed limits on some roads in Finland where the dates of winter speed limits change each year. See Key:maxspeed:conditional for more details.
  • Road condition: For example, wet, snow. It is noted that the condition wet corresponds to :wet in, e.g., maxspeed:wet=*. Using wet as a condition is recommended in order to streamline the syntax of restriction tags ("maxspeed:wet" was introduced at a time when no proper way of tagging conditional restrictions existed).
  • Vehicle property: Some examples of properties are weight, axleload, length, width, height, wheels and draught (for ships). Use relative operators (<, >, =, <=, >=) to define the condition. E.g. weight<7.5.
  • Vehicle usage: The restriction depends on how the vehicle is used, such as the number of occupants or the load. Examples: (occupants>1) (a typical condition for a vehicle to use an "hov" lane), hazmat (vehicle carrying hazardous materials).
  • User group: The restriction relates to a specific user group, e.g. doctor, disabled, emergency, female.
  • Purpose of access: For restriction types expecting a numerical restriction value such as maxweight the condition may be a purpose-of-access condition (destination, delivery etc) or a permission type condition (private, permit etc). Example:
    maxweight=2.5
    maxweight:conditional=none @ destination.
  • Stay duration: The restriction depends on how long vehicle remains at the location, such as time parked. Use stay for stay duration. Examples: (stay < 2 hours) (where stay duration is less than 2 hours).
  • Combined condition: Two or more partial conditions may be combined using the operator AND. It is recommended to use the uppercase form to improve readability. AND means that both partial conditions must be fulfilled for the condition to apply. Example: destination @ Sa-Su AND weight>7.

Default restrictions

It is not always clear which restriction applies when the condition is not fulfilled. In such cases the default restriction should also be specified; e.g., maxspeed=120 + maxspeed:conditional=100 @ 20:00-06:00. In some cases, a default restriction can be assumed and need not be explicitly tagged. For many highway classes like "unclassified", an implicit access=yes is assumed. See OSM tags for routing/Access-Restrictions for default access restrictions for different highway classes. However that may be, when using conditional tag, it is recommended to mark the default value in overt form in all cases.

Evaluation of conflicting restrictions

When an object has two or more different restrictions both matching the given traffic and conditions, the following algorithm determines which one is valid.

  1. A restriction having a more specific transportation mode overrules a less specific transportation mode. E.g., a tag for "psv" overrules a tag for "motor_vehicle" in case of a public service vehicle. See Key:access#Transport mode restrictions for the transport mode hierarchy.
  2. A directional restriction overrules a non-directional restriction of the same transportation mode
  3. A conditional restriction overrules a non-conditional restriction of the same transportation mode and direction
  4. A Lanes restriction, evaluated per-lane, overrules a restriction of the same transportation mode (whether conditional or directional)
  5. A conditional lanes restriction, evaluated per-lane, overrules a non-conditional lanes restriction
  6. In case of multiple matching value-condition pairs in the same tag the last matching value becomes the effective restriction value. Therefore it is important to put the more general restriction first and the more specific restriction last. Some examples:
    • (access=yes) + access:conditional=no @ 09:00-17:00; destination @ 09:00-17:00 AND disabled will allow destination traffic for disabled persons (the last match) while all other traffic isn't allowed 9am-5pm. The time condition needs to be repeated in the second value, otherwise disabled persons would only have destination access 17:00-09:00 while all other traffic would have general access.
    • (maxspeed=none) + maxspeed:conditional=120 @ 06:00-20:00; 80 @ wet: Here the 80 at wet will overrule the time based restriction in case of wet conditions.
    • (access=no) + access:conditional=delivery @ 07:00-11:00; customers @ 07:00-17:00: Here is actually no conflict as only one value can match (the purpose of access must match in case of destination, customers, delivery, agricultural and forestry).

Exceptions

  • Parking lane restrictions formerly defined its own way of dealing with conditions but has now been harmonized with this tagging scheme.

Examples

Speed limit

Main article: Key:maxspeed:conditional
Photo Tagging Interpretation
Speedlimit120-timecondition.jpg maxspeed=120
maxspeed:conditional=130 @ 19:00-06:00

The speed is limited to 120 km/h from 6 AM to 7 PM, but the default of 130 km/h applies otherwise (example from Dutch motorway).

Note that maxspeed=* contains the daytime situation as decided by the Dutch OSM community.

Zeichen 274-120 - Zulässige Höchstgeschwindigkeit, StVO 2017.svg
6-20 h
Zeichen 274-100 - Zulässige Höchstgeschwindigkeit, StVO 2017.svg
22-6 h
maxspeed=none
maxspeed:conditional=120 @ 06:00-20:00; 100 @ 22:00-06:00
Two conditional maxspeed values valid at different times of day (this is a real example from a motorway in Germany).
maxspeed=120
maxspeed:conditional=none @ 20:00-22:00; 100 @ 22:00-06:00
Speed limit of 60 for HGV with weight more than 7.5t.jpg maxspeed=80
maxspeed:hgv:conditional=60 @ weight>7.5
Example for a conditional speed limit applicable to a specific transportation mode.

Traffic modes

Photo Tagging Interpretation
Conditional-access-bicycle-and-delivery.jpg

highway=pedestrian
motor_vehicle:conditional=delivery @ (Mo-Fr 06:00-11:00,17:00-19:00; Sa 03:30-19:00)
bicycle=yes
bicycle:conditional=no @ (Sa 08:00-16:00)
mofa=no
moped=no

Complex example from a Dutch pedestrian street. Delivery traffic ("bevoorradingsverkeer") allowed access at certain time intervals. Bicycles ("fietsen") are allowed except on Saturdays 8–16 h. Mofas and mopeds ("snor- en bromfietsen") not allowed.
motor_vehicle:conditional=no @ 2018 May 22-2018 Oct 7 Section of road is closed for motor vehicles for a few months (for construction). Navigation after the end date should work even for maps created in the meantime. (See also temporary:*=*)
Motorcycle restriction conditional.png motorcycle:conditional=no @ (Sa,Su,PH) Motorcycles not allowed on weekends and public holidays
UK motor restriction sign with exceptions.jpg

highway=tertiary
motor_vehicle=no
motor_vehicle:conditional=yes @ 18:30-07:30
psv=yes

This is a camera-enforced "bus gate"; motor vehicles are prohibited from 07:30 to 18:30 except for PSVs. Times need to be switched around (against as they appear on the sign) if you want to use motor_vehicle=no as a fallback. (Note: "local buses" not handled yet)

highway=path
motorcycle=no
motorcycle:conditional=yes @ Jun 1-Oct 1

Motorcycles are only allowed on this trail June 1st through October 1st.

Vehicle dimension

Photo Tagging Interpretation
access:conditional=destination @ weight>5.5 Only destination traffic is allowed for over 5.5t.
motor_vehicle:conditional=destination @ weight>5.5 Motorized Vehicles over 5.5t are only allowed for destination traffic.

maxweight=5.5
maxweight:conditional=none @ destination

Only destination traffic allowed for weight of over 5.5t.
Maxweight except buses and for loading.jpg maxweightrating=7.5
maxweightrating:bus=none
maxweightrating:conditional=none @ delivery
There is a maxweightrating restriction which is overruled by maxweightrating:bus (as this includes a more specific transportation mode) and by maxweightrating:conditional (a conditional restriction of the same transportation type — i.e. none specified — as maxweightrating=). Therefore, the maximum weight rating of 7.5 t applies to all vehicles except buses and those loading ('delivery').
maxweightrating:hgv=7.5
maxweightrating:hgv:conditional=none @ delivery
Note the sign only applies to heavy goods vehicles so this could be solved this way.
Length and time restriction 2.jpg motor_vehicle:conditional=no @ 10:00-18:00 AND length>5 Motorized vehicles longer than 5 metre not allowed 10am - 6pm
maxlength:conditional=5 @ 10:00-18:00 Longer than 5 metre not allowed 10am - 6pm

maxlength=5
maxlength:conditional=none @ 18:00-10:00

Longer than 5 metre not allowed 10am - 6pm
Conditional time weight.png hgv:conditional=no @ 06:00-22:00 AND weight>5 This is a vehicle specific time and weight restriction for HGVs
maxweight:hgv:conditional=5 @ 06:00-22:00 This is a vehicle specific time and weight restriction for HGVs

maxweight:hgv=5
maxweight:hgv:conditional=none @ 22:00-06:00

This is a vehicle specific time and weight restriction for HGVs
Örebro unusual traffic sign (cropped).jpg

motor_vehicle=no
motor_vehicle:conditional=yes @ length>14

The sign translates as: (No motor vehicles). Does not apply to vehicles longer than 14 m.

Travel direction

Photo Tagging Interpretation

oneway:conditional=yes @ Su
oneway:bicycle=no

Street is oneway on Sundays but bicycles may use it in both directions at all times. The second tag overrules the conditional tag because of the specific transportation mode 'bicycle'.

oneway=yes
oneway:conditional=-1 @ Mo-Fr 07:00-10:00

This road is a oneway by default. It temporarily allows traffic in the opposite direction on Monday through Friday.

oneway=no + oneway:conditional=yes @ (Sa-Su;PH), or
oneway=yes + oneway:conditional=no @ (Mo-Fr;PH off)

For a road that is a oneway active on weekends (Sa-Su) and public holidays (PH)

oneway=no + oneway:conditional=yes @ (Mo-Fr;PH off), or
oneway=yes + oneway:conditional=no @ (Sa-Su;PH)

For a road that is a oneway active during weekdays (Mo-Fr) except public holidays (PH)
oneway:conditional=-1 @ 17:00-20:00; yes @ 06:00-08:00 This road is bidirectional by default. It is a oneway from 6-8 AM in the direction drawn and a oneway in the reverse direction from 5-8 PM.

oneway=yes
oneway:conditional=no @ (Mo-Fr 14:00-21:00; Sa-Su,PH 07:00-10:00)

This road is a oneway by default. It is bidirectional from 2-9 PM on weekdays (Mo-Fr) and 7-10 AM on weekends (Sa-Su) and public holidays (PH).
Hgv-no-overtaking-condition.jpg overtaking:hgv:conditional=no @ Mo-Fr 06:00-19:00 Overtaking not permitted for heavy goods vehicles 6–19h on weekdays (example from Dutch motorway)

Pricing

Photo Tagging Interpretation

fee=no
fee:conditional=yes @ stay > 2 hours[1]

Parking where you are not paying for stay lasting no more than 2 hours

fee=yes
fee:conditional=no @ (stay < 2 hours)

Parking where you are not paying for stay lasting no more than 2 hours. The same meaning as previous, but with different default (makes difference as conditional restrictions is not always processed - it is better to put safer/less surprising value in a default).
node 472125058

fee=yes
fee:conditional=no @ Mo

For an object with a free entrance/use on Mondays - in this case a museum but may apply for example to a parking.

Durations

Photo Tagging Interpretation

amenity=parking
maxstay=1.5 hour
access:conditional=no @ (Su,PH)

Parking where you're allowed to stay only 90 minutes, except on Sunday and public holidays when you're not allowed to stay at all

amenity=parking
maxstay=1.5 hour
maxstay:conditional=no @ (Su,PH)

Parking where you're allowed to stay only 90 minutes, except on Sunday and public holidays when there is no limit

User groups

Photo Tagging Interpretation
Based on way 232081251 female=no

female:conditional=yes @ (7 Feb, 25 Mar)

For an object where woman are generally not allowed, except some specific days during a year.

Turn restrictions

Photo Tagging Interpretation
type=restriction

restriction:conditional=no_left_turn @ Mo-Fr 07:00-09:00,16:00-18:00

relation No left turns allowed at this junction between 7-9AM and 4-6PM, applies Monday to Friday.
Ottawa complicated conditional no left turn.jpeg type=restriction

restriction:conditional=no_left_turn @ 07:00-09:00,15:30-17:30
except=bicycle

relation No left turns between 7am and 9am, or between 3:30pm to 5:30pm, except bicycles.
AU NSW no left turn conditional length.png type=restriction

restriction:conditional=no_left_turn @ length > 6

restriction:conditional=no_right_turn @ (Mo-Fr;PH off) For a road that is a no right turn except weekends (Sa-Su) and public holidays (PH)
Conditional turn.png type=restriction

restriction:conditional=no_u_turn @ 06:00-22:00
except=moped;motorcycle;mofa

This is a conditional turn restriction that prevents vehicles except mopeds, motorcycles, mofas from making a U-turn from 06:00-22:00.

Deprecated tags

This scheme deprecates the following tags when they are used in combination with restriction tags.

If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!
If you know places with this tag, verify if it could be tagged with another tag.
Automated edits are strongly discouraged unless you really know what you are doing!

By-use modes

The present scheme treats the by-use modes hov=*, emergency=*, hazmat=* and disabled=* as conditions, not as transportation modes. This will allow more complex restrictions like access:conditional=destination @ (hazmat:A AND weight>7.5). It is recommended to tag such by-use modes as real conditions instead of using pseudo-transportation modes although such tagging is not explicitly deprecated with this scheme.

Other conditionals

Over the years, some conditional keys have emerged, that don't describe a restriction, for example:

Software support

Routers

Feature BRouter GraphHopper Openrouteservice OpenTripPlanner Organic Maps OsmAnd OSRM Valhalla
Access (access:conditional=*, hgv:conditional=* motorcar:conditional=*, etc.) No v0.6.0 v6.5.0 No 2021-04-24 v3.4 No v2.5.0
Lanes no no no no no v3.4 no no
Locks (locked:conditional=*) no no no no 2021-04-24 no no no
Speed limits (maxspeed:conditional=*) No no v6.5.0 no No v1.6 (Netherlands)
v3.4 (worldwide)
No No
Tolls (toll:conditional=*) no no no no no v3.4 no no
Turn restrictions (restriction:conditional=*) no No no no no v3.4 v5.8.0 v2.5.0
Fees (fee:conditional=*)
?
?
?
?
no no
?
?
Full dates No v0.6.0 no no 2021-04-24 v3.4 v5.8.0 v2.5.0
Days of the year No v0.6.0 v6.5.0 no 2021-04-24 v3.4 v5.8.0 v2.5.0
Months No v0.6.0 v6.5.0 no 2021-04-24 v3.4 v5.8.0 v2.5.0
Weeks of the month No No No no 2021-04-24 v3.4 No v2.5.0
Days of the week No v0.6.0 v6.5.0 no 2021-04-24 v3.4 v5.8.0 v2.5.0
Times no No v6.5.0 no 2021-04-24 v3.4 v5.8.0 v2.5.0
Holidays and seasons no No no no no no No no
Solar position no no no no no v3.4 v5.8.0 no
Multiple conditions separated by semicolons no No no no
?
v3.4 v5.8.0 v2.5.0
Time zone differences over the course of the route no no v6.5.0v7.0.0 no no no yes v2.5.0

OsmAnd's support for conditional restrictions can be activated in the navigation settings menu.

Renderers

CyclOSM does render conditional access restrictions next to affected roads or paths at zoom level 20 (example). Access restrictions on nodes are not rendered.

CityParkingWeb renders conditional access and fee tags on parking lots/lanes.

See also

References