![]() |
VOOZH | about |
| 👁 Logo. Feature: Conditional restrictions |
| 👁 One example for Feature: Conditional restrictions |
| Description |
| To tag restrictions being dependent on a condition. |
| Group |
| Tags |
|
|
Restrictions (such as access=private or maxspeed=60) sometimes exist only when certain conditions are met. Those conditions can be described using "conditional tags".
Conditional tags are usually used with a normal, unconditional restriction tag. The normal tag is taken to be valid normally, and the conditions specified are exceptions to the normal rule.
Conditional tags are built as follows:
:conditional to what would be the normal key@ followed by the condition.Exceptions are often determined by times or time periods.
access=private (normal tag)access:conditional=yes @ Dec 25 (conditional tag)maxspeed=100 (normal tag)maxspeed:conditional=60 @ 23:00-05:00 (conditional tag)Where the exception is determined by transport mode, the transport mode is added to the key as a suffix.
oneway=yes (normal tag)oneway:bicycle=no (conditional tag)Where the normal rule is implied, a normal tag is not needed.
Additionally, access restrictions determined by transport mode should be tagged without the expected prefix access: , because this term is implied.
access:hgv=no (conditional tag)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 specific to a specific mode of transport, the expected restriction-type prefix access: is omitted (as it is in normal tags).
<transportation mode> [: <direction> ]:conditional = <restriction-value> @ <condition> [;<restriction-value> @ <condition>]
The key is constructed in the same way as keys for established restriction tags with an additional :conditional suffix.
The <restriction-type> can be any type of restriction that may have conditional validity. Common examples are access=*, maxspeed=*, oneway=* and maxstay=* restrictions. The restriction type should reflect the "main" traffic sign. For the File:Vorschriftszeichen 1.svg sign, having an additional sign specifying a condition the type should be vehicle. On the other hand, for the sign File:Nederlands verkeersbord C17.svg, the restriction type should be maxlength (similar for other max<dimension> signs).
The <transportation mode> key-part specifies the transportation mode to which the restriction applies, e.g. bicycle, motor_vehicle, foot, agricultural, ....
Example: vehicle:conditional=*
The <direction> key-part can be used when a restriction is 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".
The value comprises the conditional restriction itself, followed by the @ character, followed by 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 access=permit (almost always granted to everyone as part of the procedure of travelling) in OSM.
The <restriction-value> is the actual value of the restriction; e.g. yes, private, 80, 55 mph, 2 hours. 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).
Note that, although the condition may sometimes be in parentheses, the restriction value never is. For example, bus:lanes:conditional=yes|designated @ Mo-Fr 07:00-09:00 is syntactically correct, but bus:lanes:conditional=(yes|designated) @ Mo-Fr 07:00-09:00 is incorrect, since (yes|designated) is an invalid value for bus:lanes=*.
The <condition> 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:
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.
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).maxweight=2.5maxweight:conditional=none @ destination.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.
When an object has two or more different restrictions both matching the given traffic and conditions, the following algorithm determines which one is valid.
| Photo | Tagging | Interpretation |
|---|---|---|
| 👁 Image |
maxspeed=120maxspeed: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 |
| File:Zeichen 274-120 - Zulässige Höchstgeschwindigkeit, StVO 2017.svg 6-20 h File:Zeichen 274-100 - Zulässige Höchstgeschwindigkeit, StVO 2017.svg 22-6 h |
maxspeed=nonemaxspeed: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=120maxspeed:conditional=none @ 20:00-22:00; 100 @ 22:00-06:00
| ||
| 👁 Image |
maxspeed=80maxspeed:hgv:conditional=60 @ weight>7.5
|
Example for a conditional speed limit applicable to a specific transportation mode. |
| Photo | Tagging | Interpretation |
|---|---|---|
| 👁 Image |
|
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 07)
|
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:*=*)
| |
| File:Motorcycle restriction conditional.png | motorcycle:conditional=no @ (Sa,Su,PH)
|
Motorcycles not allowed on weekends and public holidays |
| 👁 Image |
|
This is a camera-enforced "bus gate"; motor vehicles are prohibited from 07:30 to 18:30 except for local buses, taxis and licensed private hire. 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" and "private hire vehicles" not handled yet) |
|
|
Motorcycles are only allowed on this trail June 1st through October 1st. | |
| 👁 Image |
|
Bicycle are not allowed between 9 till 20 o'clock.
Because virtually no data users support conditional restrictions yet, some mappers prefer to deny bicycles by default and add a conditional to allow them at certain times, as in this example. |
| 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. | |
|
|
Only destination traffic allowed for weight of over 5.5t. | |
| 👁 Image |
maxweightrating:hgv=7.5maxweightrating:hgv:conditional=none @ deliverybus=yes
|
Goods vehicles over 7.5 tonnes are prohibited, except for loading and buses.
Note the sign here in this example is |
| 👁 Image |
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 | |
|
|
Longer than 5 metre not allowed 10am - 6pm | |
| File:UK traffic sign 622.1A.svg06:00-22:00 | hgv:conditional=no @ 06:00-22:00 AND weightrating>7.5
|
This is a vehicle specific time and weight restriction for HGVs |
maxweightrating:hgv:conditional=7.5 @ 06:00-22:00
|
This is a vehicle specific time and weight restriction for HGVs | |
|
|
This is a vehicle specific time and weight restriction for HGVs | |
| Error creating thumbnail: |
|
The sign translates as: (No motor vehicles). Does not apply to vehicles longer than 14 m. |
| Photo | Tagging | Interpretation |
|---|---|---|
|
|
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'. | |
|
|
This road is a oneway by default. It temporarily allows traffic in the opposite direction on Monday through Friday. | |
|
|
For a road that is a oneway active on weekends (Sa-Su) and public holidays (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. | |
|
|
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). | |
|
|
This road is a oneway by default. It is bidirectional for local traffic only. | |
| 👁 Image |
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) |
| Photo | Tagging | Interpretation |
|---|---|---|
|
|
Parking where you are not paying for stay lasting no more than 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). | |
| 472125058👁 node 472125058 |
|
For an object with a free entrance/use on Mondays - in this case a museum but may apply for example to a parking. |
| Photo | Tagging | Interpretation |
|---|---|---|
amenity=parkingmaxstay:conditional=1 hour @ 10:00-20:00
|
Parking where you can only stay 1 hour during the hours of 10am to 8pm (and as long as you like outside those hours) | |
|
|
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 | |
|
|
Parking where you're allowed to stay only 90 minutes, except on Sunday and public holidays when there is no limit |
| Photo | Tagging | Interpretation |
|---|---|---|
| Based on 232081251👁 way 232081251 |
female=no
|
For an object where woman are generally not allowed, except some specific days during a year. |
| Photo | Tagging | Interpretation |
|---|---|---|
type=restriction
|
No left turns allowed at this junction between 7-9AM and 4-6PM, applies Monday to Friday.👁 relation No left turns allowed at this junction between 7-9AM and 4-6PM, applies Monday to Friday. | |
| 👁 Image |
type=restriction
|
No left turns between 7am and 9am, or between 3:30pm to 5:30pm, except bicycles.👁 relation No left turns between 7am and 9am, or between 3:30pm to 5:30pm, except bicycles. |
| 👁 Image |
type=restriction
| |
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) | |
| File:Vietnam road sign P124b1.svg File:Vietnam road sign S508a.svg |
type=restriction
|
This is a conditional turn restriction that prevents vehicles except mopeds, motorcycles, mofas from making a U-turn from 07:30-10:30. |
Conditional syntax may be used, if necessary, for destination symbols prewarning about remote access restrictions or recommendations.
| Signs | Tagging | Notes |
|---|---|---|
| 👁 Image France
|
On the 👁 way way branching off the junction to the right:
|
Use of conditional restriction necessitated by the complexity of the rule: the right highway is recommended (designated) for goods vehicles
Please note the parenthesis enclosing the successive restriction values of |
| Error creating thumbnail:
France
|
On the 👁 way way branching off the junction to the left:
|
Use of conditional restriction necessitated by the complexity of the rule: the left highway is recommended (designated) for goods vehicles whose max allowed weight is above 7.5 metric tons.
The highway branching off to the right has a single |
|
France
|
On the 👁 way way branching off the junction to the right:
|
The two destination restriction indications (here, pictograms) are both mapped as value-condition pairs in the same destination:access:goods:conditional=* tag; their respective order on the sign is followed in destination:access:goods:conditional=*, to allow correct rendering order. Using destination:symbol=* to give their respective order is thus useless.
|
| Error creating thumbnail:
France
|
On the 👁 way way branching off the junction to the right:
|
Use of conditional restriction necessitated by the complexity of the rule: the right highway is recommended (designated) for goods vehicles more than 9 meters long.
Please note the parenthesis enclosing the successive restriction values of As some destinations have a |
| File:Panneau D21b fond vert avec idéogramme SC1b.jpg
France
|
On the 👁 way way branching off the junction to the left:
|
Use of conditional restriction necessitated by the complexity of the rule: the left highway is recommended (designated) for vehicles whose max allowed weight is more than 3.5t.
This case of a single |
This scheme deprecates the following tags when they are used in combination with restriction tags.
date_on=*date_off=*day_on=*day_off=*hour_on=*hour_off=*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.
Over the years, some conditional keys have emerged, that don't describe a restriction, for example:
interval:conditional=*duration:conditional=*cycleway:left:conditional=*traffic_sign:conditional=*route:conditional=*| Feature | BRouter | CoMaps | GraphHopper | Openrouteservice | OpenTripPlanner | Organic Maps | OsmAnd | OSRM | Valhalla |
|---|---|---|---|---|---|---|---|---|---|
| Types of restrictions / tags that can be made conditional | |||||||||
Access (access:conditional=*, hgv:conditional=* motorcar:conditional=*, etc.)
|
No | Yes | v0.6.0 | v6.5.0 | No | yes | v3.4 | No | v2.5.0 |
| Lanes | no | no | no | no | no | no | v3.4 | no | no |
Locks (locked:conditional=*)
|
no | yes | no | no | no | yes | no | no | no |
Speed limits (maxspeed:conditional=*)
|
No | no | no | v6.5.0 | no | No | v1.6 (Netherlands) v3.4 (worldwide) |
No | no[2] |
Tolls (toll:conditional=*)
|
no | no | no | no | no | no | v3.4 | no | no |
Turn restrictions (restriction:conditional=*)
|
no | no | No | no | no | no | No [1] | v5.8.0 | v2.5.0 |
Fees (fee:conditional=*)
|
? | no | ? | ? | ? | no | no | ? | ? |
| Constructs that can be used in conditions | |||||||||
| Full dates | No | yes | v0.6.0 | no | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Days of the year | No | yes | v0.6.0 | v6.5.0 | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Months | No | yes | v0.6.0 | v6.5.0 | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Weeks of the month | No | yes | No | No | no | yes | v3.4 | No | v2.5.0 |
| Days of the week | No | yes | v0.6.0 | v6.5.0 | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Times | no | yes | No | v6.5.0 | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Holidays and seasons | no | no | No | no | no | no | no | No | no |
| Solar position | no | no | no | no | no | no | v3.4 | v5.8.0 | no |
| Multiple conditions separated by semicolons | no | yes | No | no | no | yes | v3.4 | v5.8.0 | v2.5.0 |
| Determination of evaluation time | |||||||||
| Query can specify custom time at which to evaluate restrictions | ? | no | ? | ? | ? | no | no | no | yes |
| Accounts for passage of time while traveling the route | ? | No | ? | ? | ? | no | no | no | yes |
| Time zone differences over the course of the route | no | no | no | v6.5.0–v7.0.0 | no | no | no | yes | v2.5.0 |
OsmAnd's support for conditional restrictions can be activated in the navigation settings menu.
OSRM's support for time-conditional restrictions requires running a script to specialize the data set for a given evaluation time and load it into the server. In principle, a public server could be configured to automatically run this script at frequent intervals so that a query submitted at a given time has restrictions evaluated at approximately the same time. This is extra work, so some public servers may not implement it and thus may ignore time-conditional restrictions. As of 2025-09-05, the OSRM server used by openstreetmap.org appeared to ignore time-conditional restrictions in one test. Of course, if you're running your own OSRM server for testing, you can run the script as many times as you want to test evaluation times of your choosing.
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.
| ||||||||||||||||