From 61ba7581735968bd3a6c7a7def43ddf4aa775be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 5 Sep 2024 09:38:55 +0200 Subject: [PATCH] Modify queries to accept multi-value tags (e.g. amenity=bar;restaurant) --- car_amenities.yaml | 14 +++--- communication.yaml | 10 ++--- craft.yaml | 3 +- culture-media.yaml | 10 ++--- culture.yaml | 35 +++++++-------- cycle_amenities.yaml | 22 +++++----- education.yaml | 43 +++++++++++++------ emergency.yaml | 52 +++++++++++----------- financial.yaml | 47 +++++++++++--------- gastro.yaml | 6 +-- health.yaml | 24 +++++------ law.yaml | 35 ++++++++------- public.yaml | 57 ++++++++++++++---------- religion.yaml | 100 +++++++++++++++++++------------------------ waste.yaml | 74 +++++++++++++++----------------- 15 files changed, 273 insertions(+), 259 deletions(-) diff --git a/car_amenities.yaml b/car_amenities.yaml index fdab8c3..1c32af3 100644 --- a/car_amenities.yaml +++ b/car_amenities.yaml @@ -25,22 +25,22 @@ name: query: 13: |- ( - nwr[amenity~"^(car_rental|car_sharing|fuel)$"]; - nwr[amenity~"^(charging_station)$"][motorcar][motorcar!="no"]; - nwr[amenity~"^(charging_station)$"][motorcycle][motorcycle!="no"]; + nwr[amenity~"^(.*;|)(car_rental|car_sharing|fuel)(;.*|)$"]; + nwr[amenity~"^(.*;|)(charging_station)(;.*|)$"][motorcar][motorcar!="no"]; + nwr[amenity~"^(.*;|)(charging_station)(;.*|)$"][motorcycle][motorcycle!="no"]; ) 16: |- ( - nwr[amenity~"^(car_rental|car_sharing|car_wash|fuel|motorcycle_parking|parking)$"]; - nwr[amenity~"^(charging_station)$"][motorcar][motorcar!="no"]; - nwr[amenity~"^(charging_station)$"][motorcycle][motorcycle!="no"]; + nwr[amenity~"^(.*;|)(car_rental|car_sharing|car_wash|fuel|motorcycle_parking|parking)(;.*|)$"]; + nwr[amenity~"^(.*;|)(charging_station)(;.*|)$"][motorcar][motorcar!="no"]; + nwr[amenity~"^(.*;|)(charging_station)(;.*|)$"][motorcycle][motorcycle!="no"]; ) feature: pre: |- {% set key = 'amenity' %} {% set value = tags.amenity %} description: |- - {{ tagTrans(key, value) }} + {{ tagTransList(key, value) }} markerSign: |- {{ const[value] }} const: diff --git a/communication.yaml b/communication.yaml index 76f0dd3..939b5b0 100644 --- a/communication.yaml +++ b/communication.yaml @@ -27,13 +27,13 @@ name: query: 13: |- ( - nwr[amenity~'^(post_office|internet_cafe)$']; - nwr[office~"^(telecommunication|it|newspaper|publisher|advertising_agency)$"]; + nwr[amenity~'^(.*;|)(post_office|internet_cafe)(;.*|)$']; + nwr[office~"^(.*;|)(telecommunication|it|newspaper|publisher|advertising_agency)(;.*|)$"]; ); 15: |- ( - nwr[amenity~'^(post_office|internet_cafe|post_box|parcel_locker|telephone)$']; - nwr[office~"^(telecommunication|it|newspaper|publisher|advertising_agency)$"]; + nwr[amenity~'^(.*;|)(post_office|internet_cafe|post_box|parcel_locker|telephone)(;.*|)$']; + nwr[office~"^(.*;|)(telecommunication|it|newspaper|publisher|advertising_agency)(;.*|)$"]; nwr[vending~"^(|.*;)parcel_pickup(;.*|)$"]; nwr[vending~"^(|.*;)parcel_mail_in(;.*|)$"]; ); @@ -52,7 +52,7 @@ feature: {% endif %} description: |- {% if key == 'office' %} - {{ keyTrans('office') }} ({{ tagTrans('office', tags.office) }}) + {{ keyTrans('office') }} ({{ tagTransList('office', tags.office) }}) {% else %} {{ tagTransList(key, value) }} {% endif %} diff --git a/craft.yaml b/craft.yaml index 849a675..adfe7ad 100644 --- a/craft.yaml +++ b/craft.yaml @@ -20,7 +20,7 @@ name: sr: Занат tr: El Sanatları query: - 15: (node[craft];way[craft];relation[craft];); + 15: nwr[craft] feature: description: '{{ tagTransList("craft", tags.craft) }}' markerSign: '{% set craft0 = tags.craft|split(";")[0] %}{% if const.crafts[craft0] %}{% set v = const.crafts[craft0] %}{% else %}{% set v = const.default %}{% endif %}{% if v|slice(0, 3) == "fa-" %}{% else %}{{ v|raw }}{% endif %}' @@ -86,4 +86,5 @@ filter: name: '{{ trans("filter:type") }}' type: select show_default: 'true' + op: has values: '{% set list = [] %}{% for t, v in const.crafts %}{% endfor %}' diff --git a/culture-media.yaml b/culture-media.yaml index 4033dd7..a73c1c3 100644 --- a/culture-media.yaml +++ b/culture-media.yaml @@ -13,10 +13,10 @@ query: 15: | ( nwr[historic]; - nwr[tourism~'^(attraction|artwork)$']; + nwr[tourism~'^(.*;|)(attraction|artwork)(;.*|)$']; nwr[heritage]; - nwr[amenity~'^(fountain|arts_centre|place_of_worship|theatre)$']; - nwr[man_made~'^(windmill|watermill|bridge|cairn|cross|geoglyph|hongsalmun|iljumun|lighthouse|obelisk|observatory|offshore_platform|paifang|stupa|torii)$']; + nwr[amenity~'^(.*;|)(fountain|arts_centre|place_of_worship|theatre)(;.*|)$']; + nwr[man_made~'^(.*;|)(windmill|watermill|bridge|cairn|cross|geoglyph|hongsalmun|iljumun|lighthouse|obelisk|observatory|offshore_platform|paifang|stupa|torii)(;.*|)$']; ) feature: pre: | @@ -71,13 +71,13 @@ feature: {% elseif tags.tourism %} {{ tagTransList('tourism', tags.tourism) }} {% elseif tags.amenity %} - {{ tagTrans('amenity', tags.amenity) }} + {{ tagTransList('amenity', tags.amenity) }} {% elseif tags.building %} {{ tags.building == 'yes' ? keyTrans('building') : tagTrans('building', tags.building) }} {% elseif tags.heritage %} {{ keyTrans('heritage') }} {% elseif tags.man_made %} - {{ tagTrans('man_made', tags.man_made) }} + {{ tagTransList('man_made', tags.man_made) }} {% endif %} markerSymbol: "{{ markerPointer({ fillColor: def.color })|raw }}" listMarkerSymbol: "{{ markerCircle({ fillColor: def.color })|raw }}" diff --git a/culture.yaml b/culture.yaml index 5f70039..aa9ca50 100644 --- a/culture.yaml +++ b/culture.yaml @@ -27,16 +27,12 @@ name: query: 13: |- ( - node[amenity~"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$"]; - way[amenity~"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$"]; - relation[amenity~"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$"]; - node[tourism~"^(artwork|gallery|museum|theme_park)$"]; - way[tourism~"^(artwork|gallery|museum|theme_park)$"]; - relation[tourism~"^(artwork|gallery|museum|theme_park)$"]; - nwr[amenity=clock][display~"^(sundial|unorthodox)$"]; - nwr[amenity=clock]["display:sundial"]; - nwr[amenity=clock]["display:unorthodox"]; - nwr[shop~"^(art)$"]; + nwr[amenity~"^(.*;|)(arts_centre|cinema|community_centre|fountain|studio|theatre)(;.*|)$"]; + nwr[tourism~"^(.*;|)(artwork|gallery|museum|theme_park)(;.*|)$"]; + nwr[amenity~"^(.*;|)clock(;.*|)$"][display~"^(sundial|unorthodox)$"]; + nwr[amenity~"^(.*;|)clock(;.*|)$"]["display:sundial"]; + nwr[amenity~"^(.*;|)clock(;.*|)$"]["display:unorthodox"]; + nwr[shop~"^(.*;|)(art)$"]; ) feature: pre: |- @@ -53,21 +49,21 @@ feature: description: |- {% if key == 'shop' %} {{ keyTrans(key) }} ({{ tagTrans(key, value) }}) - {% elseif tags.amenity == 'clock' %} + {% elseif tags.amenity matches "/^(.*;|)clock(;.*|)$/" %} {% if tags.display == 'sundial' or attribute(tags, 'display:sundial') %}{{ tagTrans('amenity', 'clock display=sundial') }}{% endif %} {% if tags.display == 'unorthodox' or attribute(tags, 'display:unorthodox') %}{{ tagTrans('amenity', 'clock display=unorthodox') }}{% endif %} {% else %} - {{ tagTrans(key, value) }} + {{ tagTransList(key, value) }} {% endif %} - {% if tags.tourism == 'museum' and tags.museum %} - ({{ tagTrans('museum', tags.museum) }}) + {% if tags.tourism matches "/^(.*;|)museum(;.*|)$/" and tags.museum %} + ({{ tagTransList('museum', tags.museum) }}) {% endif %} - {% if tags.amenity == 'theatre' and attribute(tags, 'theatre:genre') %} - ({{ tagTrans('theatre:genre', attribute(tags, 'theatre:genre')) }}) + {% if tags.amenity matches "/^(.*;|)theatre(;.*|)$/" and attribute(tags, 'theatre:genre') %} + ({{ tagTransList('theatre:genre', attribute(tags, 'theatre:genre')) }}) {% endif %} - {% if tags.amenity == 'community_centre' and tags.community_centre %} - ({{ tagTrans('community_centre', tags.community_centre) }}) + {% if tags.amenity matches "/^(.*;|)community_centre(;.*|)$/" and tags.community_centre %} + ({{ tagTransList('community_centre', tags.community_centre) }}) {% endif %} body: |-