User:Tordanik/Conditions in values

From OpenStreetMap Wiki
Jump to navigation Jump to search
This proposal has been obsoleted by Proposed features/Conditional restrictions.

This proposal lets mappers add tags that have multiple values, each of which only applies under certain conditions. Something like this is necessary to describe many traffic restrictions encountered in reality.

The proposal is an alternative to Extended conditions for access tags. It avoids special characters in keys, and only a finite number of new keys.


<basekey>:conditional = <value1> [conditionA][conditionB]; <value2> [conditionC] ...

Conditional tags use the ":conditional" suffix in the key.

The value is a semicolon-separated list of the possible values, followed by the relevant conditions (in brackets). All conditions listed for a value must be valid for this value to apply.

Possible conditions

vehicle category

Examples include:

Any vehicle category (as listed on Key:access) is a possible condition. The access tag is then only valid for vehicles from that category.

road condition

German add-on sign "when wet"
  • wet - access tag is only valid when the road is wet


  • forward - access tag is only valid in way direction
  • backward - access tag is only valid against way direction

(Note that this is different from lane-specific information: There are ways with direction-dependent restrictions that do not have multiple lanes. There also can be multiple lanes for each direction.)

vehicle properties

UK maximum vehicle length access restriction
  • weight
  • axleload
  • height
  • width
  • length
  • draught

The following operators are used:

  • > greater than
  • < less than

The comparison values are given in the same way as values for maxweight, maxaxleload etc. Therefore, numeric values default to SI units (metres for lengths, tonnes for weights).


An access tag can be restricted to certain time intervals by using a time interval string as defined for opening_hours. The time syntax itself is not part of this proposal - it is considered desirable to use the same syntax as existing tags.

As times often contain colons (to separate hours from minutes), they will often require round brackets around the time condition.

group of users

Each group of users as listed on Key:access#Values is a possible condition.


Tagging Interpretation
maxspeed = 100
maxspeed:conditional = 60 [hgv]
Maxspeed is 100 km/h for most vehicles, but 60 km/h for hgv traffic.
maxspeed = 120
maxspeed:conditional = 80 [wet]
Maxspeed is 120 km/h under normal conditions, but 80 km/h when the road is wet.
bicycle = yes
bicycle:conditional = no [10:00-18:00]
Bicycles are permitted to use this street outside 10AM-6PM.
access:conditional = destination [weight>5.5] Vehicles over 5.5t are only allowed for destination traffic.
maxspeed:conditional = 120 [hgv]; 80 [hgv][Sa,Su] Maxspeed for hgv is limited to 80 on weekends, but 120 otherwise.
maxspeed = 50
maxspeed:conditional = 30 [Mo-Fr 07:00-17:00]
Maxspeed limited to 30 on 7AM-5PM weekdays, but 50 otherwise.

Usage and evaluation details

Evaluating "conflicting" tags

  1. More specific information overrides more general information. In particular,
    • conditional values with matching conditions always override the default value, and
    • conditional values with more specific matching conditions override less specific ones.
  2. If there are conflicting values without a "specificness" hierarchy, the most restrictive rule (e.g. lowest maxspeed) is to be chosen.

See also