Closed mnalis closed 2 years ago
@Helium314 submitted this proof-of-concept on how to access the country of the current quest; but it would need to be made generic and implemented in core StreetComplete elementFilter parser
to be actually readable/usable in quests generically.
Yes, it can be done already, I see no reason to facilitate this with such hackery ("virtual tags"). Also, then every element filter would need a reverse country geocoder to function.
Use case
It has been suggested in smoking quest discussion that it might be useful to allow to check inside
elementFilter
in which country is the quest being asked. It would allow for more flexibility thendefaultDisabledMessage = R.string.default_disabled_msg_go_inside_regional_warning
; e.g. some extra conditions for quest to show (e.g.outdoor_seating != no
) might be imposed only in some counties (e.g.UK
) but only if some other matches are valid (e.g.amenity !~ nightclub|stripclub
).Such country-matching inside
elementFilter
might conceivably be used in other quests too wheredefault_disabled_msg_go_inside_regional_warning
is much too rigid.Proposed Solution
It might be accomplished by SC automatically creating virtual tag like
__QUEST_IS_IN_COUNTRY
(which has value likeUK
orDE
etc.), and then normalelementFilter
operators might be used on it, e.g.:Although, it might lead to quite complex
elementFilter
values though (example above is just a small grossly oversimplified chunk of smoking quest filter, to illustrate the possible usage if something like that were to be implemented)(such virtual tags exist in other tools, e.g.
::user
or::id
or::type
etc. in overpass-turbo which can be used in places where regular tags likename
orhighway
are normally being used.)