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-" %}<i class="fa {{ v }}"></i>{% 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 %}<option value="{{ t }}">{% set list = list|merge([ t ]) %}{{ tagTrans("craft", t) }}</option>{% endfor %}<option value="other" query="nwr[craft][craft!~"^({{ list|join("|") }})$"]">{{ trans("other") }}</option>' 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: |- <ul> @@ -128,7 +124,8 @@ filter: type: name: '{{ trans("filter:type") }}' show_default: 'true' - query: nwr[{{ value }}] + query: |- + nwr[{{ value|replace({ '=': '^' }) }}] type: select values: '{% for k, v in const %}<option value="{{ k }}">{{ trans("tag:" ~ k) }}</option>{% endfor %}<option value="other" query="nwr[amenity=fountain]">{{ trans("other") }}</option>' valueName: '{{ trans("tag:" ~ value) }}' diff --git a/cycle_amenities.yaml b/cycle_amenities.yaml index 64b3e4c..7858aa5 100644 --- a/cycle_amenities.yaml +++ b/cycle_amenities.yaml @@ -22,31 +22,31 @@ name: query: 13: |- ( - nwr[amenity~"^(bicycle_rental)$"]; - node[amenity~"^(charging_station)$"][bicycle][bicycle!="no"]; - nwr[shop~"^(bicycle)$"]; + nwr[amenity~"^(.*;|)(bicycle_rental)(;.*|)$"]; + node[amenity~"^(.*;|)(charging_station)(;.*|)$"][bicycle][bicycle!="no"]; + nwr[shop~"^(.*;|)(bicycle)(;.*|)$"]; nwr[rental~"^(.*;|)bicycle(|;.*)$"]; ) 16: |- ( - nwr[amenity~"^(bicycle_.*|compressed_air)$"]; - node[amenity~"^(charging_station)$"][bicycle][bicycle!="no"]; - nwr[shop~"^(bicycle)$"]; + nwr[amenity~"^(.*;|)(bicycle_.*|compressed_air)(;.*|)$"]; + node[amenity~"^(.*;|)(charging_station)(;.*|)$"][bicycle][bicycle!="no"]; + nwr[shop~"^(.*;|)(bicycle)(;.*|)$"]; nwr["monitoring:bicycle"]; - nwr[vending~"^(bicycle_tube)$"]; + nwr[vending~"^(.*;|)(bicycle_tube)(;.*|)$"]; nwr[rental~"^(.*;|)bicycle(|;.*)$"]; ) feature: pre: |- - {% if tags.shop in [ 'bicycle' ] %} + {% if tags.shop and 'bicycle' in tags.shop|split(';') %} {% set key = 'shop' %} {% set value = tags.shop %} {% elseif attribute(tags, "monitoring:bicycle") %} {% set key = 'man_made' %} {% set value = 'monitoring_station' %} - {% elseif tags.vending in [ 'bicycle_tube' ] %} + {% elseif tags.vending and 'bicycle_tube' in tags.vending|split(';') %} {% set key = 'vending' %} - {% set value = tags.vending %} + {% set value = 'bicycle_tube' %} {% elseif 'bicycle' in tags.rental|split(';') %} {% set key = 'amenity' %} {% set value = 'bicycle_rental' %} @@ -64,7 +64,7 @@ feature: {% if tags.amenity == 'vending_machine' %} {{ tagTransList('amenity=vending_machine vending', value) }} {% else %} - {{ tagTrans(key, value) }} + {{ tagTransList(key, value) }} {% endif %} body: |- {% if tags.capacity %} diff --git a/education.yaml b/education.yaml index 16d9aad..7780026 100644 --- a/education.yaml +++ b/education.yaml @@ -27,31 +27,41 @@ name: query: 11: |- ( - node[amenity~'^(college|university|library)$']; - way[amenity~'^(college|university|library)$']; - relation[amenity~'^(college|university|library)$']; + nwr[amenity~'^(.*;|)(college|university|library)(;.*|)$']; ) 14: |- ( - nwr[amenity~'^(college|university|library|school|kindergarten|language_school|childcare)$']; - nwr[office~"^(educational_institution|research)$"]; + nwr[amenity~'^(.*;|)(college|university|library|school|kindergarten|language_school|childcare)(;.*|)$']; + nwr[office~"^(.*;|)(educational_institution|research)(;.*|)$"]; ) 16: |- ( - nwr[amenity~'^(college|university|library|school|kindergarten|language_school|public_bookcase|childcare)$']; - nwr[office~"^(educational_institution|research)$"]; + nwr[amenity~'^(.*;|)(college|university|library|school|kindergarten|language_school|public_bookcase|childcare)(;.*|)$']; + nwr[office~"^(.*;|)(educational_institution|research)(;.*|)$"]; ) feature: pre: |- - {% if tags.office == 'educational_institution' or tags.office == 'research' %} + {% set key = null %} + {% set value = null %} + + {% if tags.office and 'educational_institution' in tags.office|split(';') %} {% set key = 'office' %} - {% set value = tags.office %} + {% set value = 'educational_institution' %} + {% elseif tags.office and 'research' in tags.office|split(';') %} + {% set key = 'office' %} + {% set value = 'research' %} {% else %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if kv[0] == 'amenity' and kv[1] in tags.amenity|split(';') %} + {% set key = 'amenity' %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} {% endif %} - description: '{{ tagTrans(key, value) }}' - body: '{% if tags.operator %}{{ keyTrans("operator") }}: {{ tags.operator }}<br/>{% endif %}' + description: '{{ tagTransList(key, attribute(tags, key)) }}' + body: | + {% if tags.operator %}{{ keyTrans("operator") }}: {{ tags.operator }}<br/>{% endif %} markerSign: |- {% set data = const[key ~ '=' ~ value] %} {% if data %} @@ -121,4 +131,9 @@ filter: name: '{{ trans("filter:type") }}' show_default: 'true' type: select - values: '{% for k, v in const %}<option value="{{ k }}" query="nwr[{{ k }}]" minzoom="{{ v.zoom }}">{{ tagTrans(k) }}</option>{% endfor %}' + values: | + {% for k, v in const %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=', '^' }) }}]" minzoom="{{ v.zoom }}"> + {{ tagTrans(k) }} + </option> + {% endfor %} diff --git a/emergency.yaml b/emergency.yaml index 4624fb3..7f85a47 100644 --- a/emergency.yaml +++ b/emergency.yaml @@ -27,32 +27,34 @@ name: query: 11: |- ( - nwr[amenity~"^(fire_station|hospital)$"]; - nwr[emergency~"^(lifeguard)$"]; + nwr[amenity~"^(.*;|)(fire_station|hospital)(;.*|)$"]; + nwr[emergency~"^(.*;|)(lifeguard)(;.*|)$"]; ) 13: |- ( - nwr[amenity~"^(fire_station|hospital|police)$"]; - nwr[emergency~"^(lifeguard)$"]; - node[emergency~"^(phone|defibrillator|access_point)$"]; - node[highway=emergency_access_point]; + nwr[amenity~"^(.*;|)(fire_station|hospital|police)(;.*|)$"]; + nwr[emergency~"^(.*;|)(lifeguard)(;.*|)$"]; + node[emergency~"^(.*;|)(phone|defibrillator|access_point)(;.*|)$"]; + node[highway^emergency_access_point]; ) feature: pre: |- - {% if tags.amenity in [ 'fire_station', 'hospital', 'police' ] %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% elseif tags.emergency %} - {% set key = 'emergency' %} - {% set value = tags.emergency %} - {% elseif tags.highway == 'emergency_access_point' %} - {% set key = 'highway' %} - {% set value = tags.highway %} - {% endif %} + {% set key = null %} + {% set value = null %} + + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} + {% set kv = key ~ "=" ~ value %} - description: '{{ tagTrans(key, value) }}' - markerSign: |- {% set data = const[kv] %} + description: |- + {{ tagTransList(key, attribute(tags, key)) }} + markerSign: |- {% if data %} {{ data.sign|raw }} {% endif %} @@ -101,22 +103,22 @@ filter: values: fire_station: name: '{{ tagTrans("amenity", "fire_station") }}' - query: nwr[amenity=fire_station] + query: nwr[amenity^fire_station] hospital: name: '{{ tagTrans("amenity", "hospital") }}' - query: nwr[amenity=hospital] + query: nwr[amenity^hospital] police: name: '{{ tagTrans("amenity", "police") }}' - query: nwr[amenity=police] + query: nwr[amenity^police] lifeguard: name: '{{ tagTrans("emergency", "lifeguard") }}' - query: nwr[emergency=lifeguard] + query: nwr[emergency^lifeguard] emergency_phone: name: '{{ tagTrans("emergency", "phone") }}' - query: node[emergency=phone] + query: node[emergency^phone] defibrillator: name: '{{ tagTrans("emergency", "defibrillator") }}' - query: node[emergency=defibrillator] + query: node[emergency^defibrillator] emergency_access_point: name: '{{ tagTrans("highway", "emergency_access_point") }}' - query: (node[highway=emergency_access_point];node[emergency=access_point];) + query: (node[highway^emergency_access_point];node[emergency^access_point];) diff --git a/financial.yaml b/financial.yaml index 57a354c..557f652 100644 --- a/financial.yaml +++ b/financial.yaml @@ -25,31 +25,31 @@ name: uk: Фінанси query: 14: |- - ( - node[amenity~"^(bank)$"]; - way[amenity~"^(bank)$"]; - relation[amenity~"^(bank)$"]; - ) + nwr[amenity~"^(.*;|)(bank)(;.*|)$"]; 15: |- ( - node[amenity~"^(bank|bureau_de_change|atm)$"]; - way[amenity~"^(bank|bureau_de_change|atm)$"]; - relation[amenity~"^(bank|bureau_de_change|atm)$"]; - node[office~"^(financial|accountant|insurance|tax|tax_advisor)$"]; - way[office~"^(financial|accountant|insurance|tax|tax_advisor)$"]; - relation[office~"^(financial|accountant|insurance|tax|tax_advisor)$"]; + nwr[amenity~"^(.*;|)(bank|bureau_de_change|atm)(;.*|)$"]; + nwr[office~"^(.*;|)(financial|accountant|insurance|tax|tax_advisor)(;.*|)$"]; ) feature: pre: |- - {% if tags.amenity %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% else %} - {% set key = 'office' %} - {% set value = tags.office %} - {% endif %} - description: '{{ tagTrans(key, value) }}' - markerSign: '{{ const[key ~ "=" ~ value].sign|raw }}' + {% set key = null %} + {% set value = null %} + + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} + + {% set kv = key ~ "=" ~ value %} + {% set data = const[kv] %} + description: |- + {{ tagTransList(key, attribute(tags, key)) }} + markerSign: |- + {{ const[kv].sign|raw }} info: |- <table> {% for kv, data in const %} @@ -96,4 +96,9 @@ filter: name: '{{ trans("filter:type") }}' show_default: 'true' type: select - values: '{% for k, v in const %}<option value="{{ k }}" query="nwr[{{ k }}]" minzoom="{{ v.zoom }}">{{ tagTrans(k) }}</option>{% endfor %}' + values: |- + {% for k, v in const %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=': '^' }) }}]" minzoom="{{ v.zoom }}"> + {{ tagTrans(k) }} + </option> + {% endfor %} diff --git a/gastro.yaml b/gastro.yaml index 8a2e3db..5a2c5f7 100644 --- a/gastro.yaml +++ b/gastro.yaml @@ -24,10 +24,10 @@ name: uk: Гастрономія type: overpass query: - 15: nwr[amenity~'^(bar|biergarten|cafe|fast_food|food_court|ice_cream|pub|restaurant|canteen)$']; + 15: nwr[amenity~'^(.*; *|)(bar|biergarten|cafe|fast_food|food_court|ice_cream|pub|restaurant|canteen)(| *;.*)$']; feature: description: | - {{ tagTrans('amenity', tags.amenity) }} + {{ tagTransList('amenity', tags.amenity) }} details: | {{ tagTransList('cuisine', tags.cuisine) }} body: | @@ -70,7 +70,7 @@ filter: - canteen valueName: | {{ tagTrans('amenity', value) }} - op: '=' + op: 'has' cuisine_food: name: | {{ keyTrans('cuisine/food') }} diff --git a/health.yaml b/health.yaml index 3cdeebc..eda2fdb 100644 --- a/health.yaml +++ b/health.yaml @@ -26,21 +26,13 @@ name: query: 11: |- ( - node[amenity~"^(hospital)$"]; - way[amenity~"^(hospital)$"]; - relation[amenity~"^(hospital)$"]; - node[healthcare~"^(hospital|clinic)$"]; - way[healthcare~"^(hospital|clinic)$"]; - relation[healthcare~"^(hospital|clinic)$"]; + nwr[amenity~"^(.*;|)(hospital)(;.*|)$"]; + nwr[healthcare~"^(.*;|)(hospital|clinic)(;.*|)$"]; ) 14: |- ( - node[amenity~"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$"]; - way[amenity~"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$"]; - relation[amenity~"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$"]; - node[healthcare]; - way[healthcare]; - relation[healthcare]; + nwr[amenity~"^(.*;|)(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)(;.*|)$"]; + nwr[healthcare]; ) feature: pre: |- @@ -51,6 +43,7 @@ feature: {% set key = 'amenity' %} {% set value = tags.amenity %} {% endif %} + {% set kv = key ~ '=' ~ value %} {% set found = { sign: '' } %} {% for data in const %} @@ -160,4 +153,9 @@ filter: name: '{{ trans("filter:type") }}' show_default: 'true' type: select - values: '{% for data in const %}<option value="{{ data.types[0] }}" query="({% for t in data.types %}nwr[{{ t }}];{% endfor %})" minzoom="{{ data.zoom }}">{{ tagTrans(data.types[0]) }}</option>{% endfor %}' + values: |- + {% for data in const %} + <option value="{{ data.types[0] }}" query="({% for t in data.types %}nwr[{{ t|replace({ '=': '^' }) }}];{% endfor %})"> + {{ tagTrans(data.types[0]) }} + </option> + {% endfor %} diff --git a/law.yaml b/law.yaml index 85089e8..89569f7 100644 --- a/law.yaml +++ b/law.yaml @@ -22,23 +22,23 @@ name: query: 14: |- ( - node[amenity~"^(courthouse)$"]; - way[amenity~"^(courthouse)$"]; - relation[amenity~"^(courthouse)$"]; - node[office~"^(lawyer|notary)$"]; - way[office~"^(lawyer|notary)$"]; - relation[office~"^(lawyer|notary)$"]; + nwr[amenity^courthouse]; + nwr[office^lawyer]; + nwr[office^notary]; ) feature: pre: |- - {% if tags.amenity %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% else %} - {% set key = 'office' %} - {% set value = tags.office %} - {% endif %} - description: '{{ tagTrans(key, value) }}' + {% set key = null %} + {% set value = null %} + + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} + description: '{{ tagTransList(key, attribute(tags, key)) }}' markerSign: '{{ const[key ~ "=" ~ value].sign|raw }}' info: |- <table> @@ -68,4 +68,9 @@ filter: name: '{{ trans("filter:type") }}' show_default: 'true' type: select - values: '{% for k, v in const %}<option value="{{ k }}" query="nwr[{{ k }}]" minzoom="{{ v.zoom }}">{{ tagTrans(k) }}</option>{% endfor %}' + values: |- + {% for k, v in const %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=': '^' }) }}]" minzoom="{{ v.zoom }}"> + {{ tagTrans(k) }} + </option> + {% endfor %} diff --git a/public.yaml b/public.yaml index 9225593..9e6c445 100644 --- a/public.yaml +++ b/public.yaml @@ -27,39 +27,41 @@ name: query: 12: |- ( - node[amenity~'^(embassy|public_building|townhall)$']; - way[amenity~'^(embassy|public_building|townhall)$']; - relation[amenity~'^(embassy|public_building|townhall)$']; - node[amenity=recycling][recyling_type=centre]; - way[amenity=recycling][recyling_type=centre]; - relation[amenity=recycling][recyling_type=centre]; - nwr[office~"^(government|administration)$"]; + nwr[amenity~'^(.*;|)(embassy|public_building|townhall)(;.*|)$']; + nwr[amenity=recycling][recyling_type=centre]; + nwr[office~"^(.*;|)(government|administration)(;.*|)$"]; ); 16: |- ( - node[amenity~'^(embassy|public_building|townhall|clock|drinking_water|recycling|toilets)$']; - way[amenity~'^(embassy|public_building|townhall|recycling|toilets)$']; - relation[amenity~'^(embassy|public_building|townhall|recycling|toilets)$']; + nwr[amenity~'^(.*;|)(embassy|public_building|townhall|clock|drinking_water|recycling|toilets)(;.*|)$']; node[drinking_water][drinking_water!=no]; - nwr[office~"^(government|administration)$"]; + nwr[office~"^(.*;|)(government|administration)(;.*|)$"]; ); feature: pre: |- - {% if tags.amenity %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% elseif tags.office %} - {% set key = 'office' %} - {% set value = tags.office %} - {% elseif tags.drinking_water and tags.drinking_water != 'no' %} - {% set key = 'amenity' %} - {% set value = 'drinking_water' %} + {% set key = null %} + {% set value = null %} + + {% if tags.drinking_water and tags.drinking_water != 'no' %} + {% set key = 'amenity' %} + {% set value = 'drinking_water' %} {% endif %} + + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} + description: |- {% if key == 'office' %} - {{ keyTrans('office') }} ({{ tagTrans('office', tags.office) }}) - {% else %} + {{ keyTrans('office') }} ({{ tagTransList('office', tags.office) }}) + {% elseif value == 'drinking_water' %} {{ tagTrans(key, value) }} + {% else %} + {{ tagTransList(key, attribute(tags, key)) }} {% endif %} body: '{% if tags.operator %}{{ keyTrans("operator") }}: {{ tags.operator }}<br/>{% endif %}' markerSign: |- @@ -91,4 +93,13 @@ filter: name: '{{ trans("filter:type") }}' show_default: 'true' type: select - values: '{% for k, v in const %}<option value="{{ k }}" query="nwr[{{ k }}]" minzoom="{{ v.zoom }}">{{ tagTrans(k) }}</option>{% endfor %}' + values: |- + {% for k, v in const %} + {% if k == 'amenity=drinking_water' %} + <option value="{{ k }}" query="(nwr[dringing_water];nwr[amenity^drinking_water];)"> + {% else %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=': '^' }) }}]"> + {% endif %} + {{ tagTrans(k) }} + </option> + {% endfor %} diff --git a/religion.yaml b/religion.yaml index b75bf62..ac395f3 100644 --- a/religion.yaml +++ b/religion.yaml @@ -27,39 +27,28 @@ name: query: 13: |- ( - node[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - way[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - relation[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - way[landuse~"^(cemetery)$"]; - relation[landuse~"^(cemetery)$"]; + nwr[amenity~"^(.*;|)(place_of_worship|grave_yard|crematorium)(;.*|)$"]; + nwr[landuse~"^(.*;|)(cemetery)(;.*|)$"]; ) 14: |- ( - node[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - way[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - relation[amenity~"^(place_of_worship|grave_yard|crematorium)$"]; - way[landuse~"^(cemetery)$"]; - relation[landuse~"^(cemetery)$"]; - node[historic~"^wayside_(cross|shrine|chapel)$"]; - way[historic~"^wayside_(cross|shrine|chapel)$"]; - relation[historic~"^wayside_(cross|shrine|chapel)$"]; - nwr[office~"^(parish|religion)$"]; + nwr[amenity~"^(.*;|)(place_of_worship|grave_yard|crematorium)(;.*|)$"]; + nwr[landuse~"^(.*;|)(cemetery)(;.*|)$"]; + nwr[historic~"^(.*;|)wayside_(cross|shrine|chapel)(;.*|)$"]; + nwr[office~"^(.*;|)(parish|religion)(;.*|)$"]; ) feature: pre: |- - {% if tags.landuse == 'cemetery' %} - {% set key = 'landuse' %} - {% set value = tags.landuse %} - {% elseif tags.historic in [ 'wayside_cross', 'wayside_shrine', 'wayside_chapel' ] %} - {% set key = 'historic' %} - {% set value = tags.historic %} - {% elseif tags.office %} - {% set key = 'office' %} - {% set value = tags.office %} - {% else %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% endif %} + {% set key = null %} + {% set value = null %} + + {% for k, d in const.types %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} description: |- {% if tags.building and tags.religion %} {% if isTranslated('tag:building=' ~ tags.building ~ ' religion=' ~ tags.religion) %} @@ -67,10 +56,10 @@ feature: {% elseif tags.building != 'yes' %} {{ trans('tag:building=' ~ tags.building) }} {% else %} - {{ tagTrans(key, value) }} + {{ tagTransList(key, attribute(tags, key)) }} {% endif %} {% else %} - {{ tagTrans(key, value) }} + {{ tagTransList(key, attribute(tags, key)) }} {% endif %} listDetails: '{{ tagTransList("religion", tags.religion) }}{% if tags.denomination %} - {{ tagTransList("denomination", tags.denomination) }}{% endif %}' body: |- @@ -85,6 +74,25 @@ feature: {% endif %} markerSign: '{{ const.religion[tags.religion] }}' const: + types: + landuse=cemetery: + zoom: 13 + historic=wayside_cross: + zoom: 14 + historic=wayside_shrine: + zoom: 14 + historic=wayside_chapel: + zoom: 14 + amenity=place_of_worship: + zoom: 13 + amenity=grave_yard: + zoom: 13 + amenity=crematorium: + zoom: 13 + office=parish: + zoom: 14 + office=religion: + zoom: 14 religion: christian: ✝ muslim: ☪ @@ -116,34 +124,12 @@ filter: show_default: 'true' query: nwr[{{ value }}] type: select - values: - place_of_worship: - name: '{{ tagTrans("amenity", "place_of_worship") }}' - query: nwr[amenity=place_of_worship] - grave_yard: - name: '{{ tagTrans("amenity", "grave_yard") }}' - query: nwr[amenity=grave_yard] - crematorium: - name: '{{ tagTrans("amenity", "crematorium") }}' - query: nwr[amenity=crematorium] - cemetery: - name: '{{ tagTrans("landuse", "cemetery") }}' - query: nwr[landuse=cemetery] - wayside_cross: - name: '{{ tagTrans("historic", "wayside_cross") }}' - query: nwr[historic=wayside_cross] - wayside_shrine: - name: '{{ tagTrans("historic", "wayside_shrine") }}' - query: nwr[historic=wayside_shrine] - wayside_chapel: - name: '{{ tagTrans("historic", "wayside_chapel") }}' - query: nwr[historic=wayside_chapel] - parish: - name: '{{ tagTrans("office", "parish") }}' - query: nwr[office=parish] - office: - name: '{{ tagTrans("office", "religion") }}' - query: nwr[office=religion] + values: |- + {% for k, v in const.types %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=': '^' }) }}]" minzoom="{{ v.zoom }}"> + {{ tagTrans(k) }} + </option> + {% endfor %} religion: name: '{{ keyTrans("religion") }}' show_default: 'true' diff --git a/waste.yaml b/waste.yaml index fc7947c..f6a3837 100644 --- a/waste.yaml +++ b/waste.yaml @@ -23,63 +23,46 @@ name: query: 13: |- ( - node[landuse=landfill]; - node[man_made~"^(wastewater_plant|incinerator)$"]; - node[amenity=recycling][recycling_type=centre]; - way[landuse=landfill]; - way[man_made~"^(wastewater_plant|incinerator)$"]; - way[amenity=recycling][recycling_type=centre]; - relation[landuse=landfill]; - relation[man_made~"^(wastewater_plant|incinerator)$"]; - relation[amenity=recycling][recycling_type=centre]; + nwr[landuse=landfill]; + nwr[man_made~"^(wastewater_plant|incinerator)$"]; + nwr[amenity=recycling][recycling_type=centre]; nwr[amenity=waste_transfer_station]; nwr[power=generator]["generator:source"~"^(.*;|)waste(;.*|)$"]; ) 15: |- ( - node[landuse=landfill]; - node[man_made~"^(wastewater_plant|incinerator)$"]; - node[amenity~"^(recycling|waste_disposal|waste_transfer_station)$"]; - way[landuse=landfill]; - way[man_made~"^(wastewater_plant|incinerator)$"]; - way[amenity~"^(recycling|waste_disposal|waste_transfer_station)$"]; - relation[landuse=landfill]; - relation[man_made~"^(wastewater_plant|incinerator)$"]; - relation[amenity~"^(recycling|waste_disposal|waste_transfer_station)$"]; + nwr[landuse=landfill]; + nwr[man_made~"^(wastewater_plant|incinerator)$"]; + nwr[amenity~"^(recycling|waste_disposal|waste_transfer_station)$"]; nwr[power=generator]["generator:source"~"^(.*;|)waste(;.*|)$"]; ) 18: |- ( - node[landuse=landfill]; - node[man_made~"^(wastewater_plant|incinerator)$"]; - node[amenity~"^(recycling|waste_basket|waste_disposal|waste_transfer_station)$"]; - way[landuse=landfill]; - way[man_made~"^(wastewater_plant|incinerator)$"]; - way[amenity~"^(recycling|waste_basket|waste_disposal|waste_transfer_station)$"]; - relation[landuse=landfill]; - relation[man_made~"^(wastewater_plant|incinerator)$"]; - relation[amenity~"^(recycling|waste_basket|waste_disposal|waste_transfer_station)$"]; + nwr[landuse=landfill]; + nwr[man_made~"^(wastewater_plant|incinerator)$"]; + nwr[amenity~"^(recycling|waste_basket|waste_disposal|waste_transfer_station)$"]; nwr[power=generator]["generator:source"~"^(.*;|)waste(;.*|)$"]; ) feature: pre: |- + {% set key = null %} + {% set value = null %} {% set add = '' %} - {% if tags.landuse == 'landfill' %} - {% set key = 'landuse' %} - {% set value = tags.landuse %} - {% elseif tags.man_made in [ 'incinerator', 'wastewater_plant' ] %} - {% set key = 'man_made' %} - {% set value = tags.man_made %} - {% elseif tags.amenity in [ 'recycling', 'waste_basket', 'waste_disposal', 'waste_transfer_station' ] %} - {% set key = 'amenity' %} - {% set value = tags.amenity %} - {% elseif tags.power == 'generator' %} - {% set key = 'power' %} - {% set value = tags.power %} + + {% for k, d in const %} + {% set kv = k|split('=') %} + {% if attribute(tags, kv[0]) and kv[1] in attribute(tags, kv[0])|split(';') %} + {% set key = kv[0] %} + {% set value = kv[1] %} + {% endif %} + {% endfor %} + + {% if key == 'power' and value == 'generator' %} {% set add = '(' ~ tagTransList('generator:source', attribute(tags, 'generator:source')) ~ ')' %} {% endif %} + {% set kv = key ~ '=' ~ value %} - description: '{{ tagTrans(key, value) }} {{ add }}' + description: '{{ tagTransList(key, attribute(tags, key)) }} {{ add }}' body: |- {% if tags.recycling_type %} {{ keyTrans('recycling_type') }}: {{ tagTrans('recycling_type', tags.recycling_type) }} @@ -105,6 +88,17 @@ info: |- <td>{{ trans('other') }}</td> </tr> </table> +filter: + type: + name: '{{ trans("filter:type") }}' + show_default: 'true' + type: select + values: |- + {% for k, v in const %} + <option value="{{ k }}" query="nwr[{{ k|replace({ '=': '^' }) }}]" minzoom="{{ v.zoom }}"> + {{ tagTrans(k) }} + </option> + {% endfor %} const: amenity=recycling: minZoom: 13