Proposed features/simplified conditional restrictions language
|A number of alternate solutions have been proposed. For a full list see Proposed_features/Advanced_access_tags. Update Oct-2012: The Conditional Restrictions proposal was approved by a majority vote.|
Both mentionned proposals have pros and cons. The major issues are:
- values are present in the key part of the tag. It's breaking the definition of a tag : a "key:value" pair. It's also creating an unlimited amount of keys making software consumers, developers (and statistic tools, editors and so on) hard life.
- for complex restrictions, the tag becomes quickly unreadable for humans and require an external software for parsing. Same for editing or creating such complex tags.
We have to follow some basic rules when we create new tags:
- tags must be readable for a wide public audience
- don't use software programming syntax or symbols (like ||, &&, ^, $, etc)
- the variable part (like speed limit or date or time) has to be on the value part of the tag
- complex conditional restrictions can be expressed therefore brackets can be used to group/subgroup expressions
Access tags already use keywords. Most of them are defined on the Key:access page like "car|foot|hgv", "yes|no", "destination", etc. We create the following new keywords which would enable a new "simplified conditinal restrictions language" (SCRL) parser:
- in : link a value like a speed limit or a height to a condition. e.g. maxspeed=120 or (80 if condition1)
- condition : a named condition for an access restriction. The keyword can be followed by a number e.g. condition1, condition2, etc. The tag condition=* defines the condition and can be used as a 'variable' in other tags present on the same OSM element. It is a mean to split long expressions to smaller but multiple tags. e.g. condition1=Mo-Fr 16:00-18:00 + hgv=condition1 instead of hgv=Mo-Fr 16:00-18:00.
(to be enhanced if required)
- No motor vehicles mon-fri between 1600-1800 except agricultural vehicles and good vehicles "in this direction". Going the other way the sign is similar but the times are between 0600 and 0900.
access=yes (this implies "agricultural=yes" and "goods=yes")
- no motor vehicles except for loading/unloading by hgvs between 8pm and 10am
condition1=loading // improving current 'destination'
hgv=condition1 and not condition2
- access:lgv.speed=120 + access:lgv?wet.speed=80
maxspeed:lgv=120 or 80 if condition1