forked from MapComplete/MapComplete
Add substituting tag, remove some old code
This commit is contained in:
parent
120832f241
commit
cd1171e678
8 changed files with 112 additions and 31 deletions
|
@ -35,3 +35,32 @@ Regex equals
|
|||
A tag can also be tested against a regex with `key~regex`. Note that this regex __must match__ the entire value. If the value is allowed to appear anywhere as substring, use `key~.*regex.*`
|
||||
|
||||
Equivalently, `key!~regex` can be used if you _don't_ want to match the regex in order to appear.
|
||||
|
||||
|
||||
Using other tags as variables
|
||||
-----------------------------
|
||||
|
||||
**This is an advanced feature - use with caution**
|
||||
|
||||
Some tags are automatically set or calculated - see [CalculatedTags](CalculatedTags.md) for an entire overview.
|
||||
If one wants to apply such a value as tag, use a substituting-tag such, for example`survey:date:={_date:now}`. Note that the separator between key and value here is `:=`.
|
||||
The text between `{` and `}` is interpreted as a key, and the respective value is substituted into the string.
|
||||
|
||||
One can also append, e.g. `key:={some_key} fixed text {some_other_key}`.
|
||||
|
||||
An assigning tag _cannot_ be used to query OpenStreetMap/Overpass.
|
||||
|
||||
If using a key or variable which might not be defined, add a condition in the mapping to hide the option.
|
||||
This is because, if `some_other_key` is not defined, one might actually upload the literal text `key={some_other_key}` to OSM - which we do not want.
|
||||
|
||||
To mitigate this, use:
|
||||
|
||||
```
|
||||
"mappings": [
|
||||
{
|
||||
"if":"key:={some_other_key}"
|
||||
"then": "...",
|
||||
"hideInAnswer": "some_other_key="
|
||||
}
|
||||
]
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue