Opened 2 years ago
Last modified 2 years ago
#22637 new enhancement
Allow positive matching for match_expression attribute in preset item
Reported by: | Woazboat | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | match_expression | Cc: | simon04 |
Description
Currently the match_expression
attribute for preset <item>
only allows you to further restrict matches for presets. (i.e. exclude things that are matched by fields in the preset but not by the match expression)
Allowing the item match expression to act as a positive match would unlock greater flexibility for presets.
For example, crossing ways can be tagged either as footway=crossing, cycleway=crossing or path=crossing. All of these have the same additional tags that could be used to further describe them (e.g. crossing:markings=*). At the moment, we would need to create three separate presets with the same content to be able to show a matching preset for each of these tags (one each with <key key="footway" value="crossing" />
, <key key="cycleway" value="crossing" />
, ...). It's also possible for these crossing ways to have both footway=crossing
and cycleway=crossing
tags if the crossing is a shared foot- and cycleway. In this case, both matching presets for footway=crossing
and cycleway=crossing
would be shown.
If the match_expression
attribute on <item>
was able to positively match objects, a single preset for these crossing ways could be created via <item type="way" match_expression="footway=crossing | cycleway=crossing | path=crossing" ...>
Attachments (0)
Change History (2)
comment:1 by , 2 years ago
comment:2 by , 2 years ago
Cc: | added |
---|---|
Keywords: | match_expression added |
Replying to Woazboat:
If the
match_expression
attribute on<item>
was able to positively match objects, a single preset for these crossing ways could be created via<item type="way" match_expression="footway=crossing | cycleway=crossing | path=crossing" ...>
As the key of the optional secondary tag depends on the value of the primary tag highway=*
, I would not use one preset for all but rather add the additional tags to the existing presets or create new ones for each. Note, you can use <chunk />
for identical tags used in several presets.
Among the default presets, only the generic presets for power plants, power generators and route network relations use
match_expression
to disable themselves if a more specialized preset could better describe the feature. These 3 presets are the only users ofmatch_expression
in the core.