Tag Selectors¶
The Tag Selection syntax is used throughout Merkaartor wherever selection by tag is required.
Mainly:
- Styles
- Tag Templates
- Filters
- "Edit-Find"
- ...
Syntax¶
The general syntax is:
<predicate> <[>key<]> operator <(>value<)> <AND|OR> <...>
operators and predicates are case insensitive.
Operators¶
"is" (alias: "=")¶
Basic "key=value" operator. Returns TRUE if the feature's key matches the value.
Example:
[highway] is residential
Alternate:
highway=residential
"isoneof"¶
Multivalue key matching. Returns TRUE if the feature's key is one of the values in the list.
Example:
[highway] isoneof (secondary , secondary_link)
Arithmetic operators (">", ">=", "<", "<=")¶
Only valid for numerical values. Returns TRUE if the arithmetic comparison is true. Return FALSE if the feature's value is not numeric.
Example:
layer<0
Special Values¶
"_NULL_"¶
"_NULL_" is the value returned if a feature do not define the specified key.
Example:
[addr:housenumber] is _NULL_
"true" / "false"¶
"True" and "false" are the boolean values.
Special Keys¶
A number of special keys are used to access the technical details of a feature.
"Type"¶
Returns the type of the feature.
Returned values are:
- node
- way
- area (returned for a closed way)
- relation
- tracksegment (i.e. the segments of a GPX)
Example:
Type is Node
":id"¶
The id of the feature
Example:
:id=30391122
":user"¶
The user having last updated the feature.
":time"¶
The date/time the feature was last updated. The value must be specified as an ISO date.
":version"¶
The version of the feature.
":dirty"¶
The modified status of the feature.
Example:
:dirty=true
":uploaded"¶
The uploaded status of the feature.
Example:
:uploaded=true
Predicates¶
NOT¶
PARENT¶
Boolean Operators¶
"NOT" (alias: "!=")¶
Does a logical "not" on the following term.
Example:
NOT [addr:housenumber] is _NULL_
Alternate example:
highway != _NULL_
"AND"¶
Does a logical "and" between 2 terms.
Example:
[place] is town and Type is Node
"OR"¶
Does a logical "or" between 2 terms.
Example:
area=yes or area=true (equivalent to "[area] isoneof (yes , true)")