Modify

Opened 17 months ago

Last modified 17 months 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 Woazboat, 17 months ago

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 of match_expression in the core.

in reply to:  description comment:2 by skyper, 17 months ago

Cc: simon04 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Woazboat.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.