diff --git a/buildings-height.json b/buildings-height.json index 6e3851a..dc08cf3 100644 --- a/buildings-height.json +++ b/buildings-height.json @@ -18,6 +18,9 @@ "pre": [ "{% if tags.height is defined %}", "{% set approxHeight = tags.height %}", + "{% set m = tags.height|matches('(.*)\\s*(m|ft)$') %}", + "{% if m and m[2] == 'm' %}{% set approxHeight = m[1] %}{% endif %}", + "{% if m and m[2] == 'ft' %}{% set approxHeight = m[1] / 3.2808 %}{% endif %}", "{% elseif attribute(tags, 'building:levels') is defined %}", "{% set approxHeight = attribute(tags, 'building:levels') * 3.5 %}", "{% endif %}", @@ -32,10 +35,13 @@ ], "description": [ "{% if tags.height is defined %}", - "{{ tags.height }}m", - "{% endif %}", + " {% if tags.height|matches('(m|ft)$') %}{{ tags.height -}}", + " {% else %}{{ tags.height }} m", + " {%- endif -%}", + "{% endif -%}", "", - "{% if attribute(tags, 'building:levels') is defined %}", + "{%- if attribute(tags, 'building:levels') is defined -%}", + "{%- if tags.height is defined %}, {% endif %}", "{{ attribute(tags, 'building:levels') }} {{ keyTrans('building:levels') }}", "{% endif %}" ], diff --git a/buildings-start_date.json b/buildings-start_date.json index d2c3ffe..326f0b5 100644 --- a/buildings-start_date.json +++ b/buildings-start_date.json @@ -16,8 +16,22 @@ }, "feature": { "pre": [ - "{% if tags.start_date %}", - " {% set value = tags.start_date|osmParseDate %}", + "{% set start_date = tags.start_date %}", + "{% if attribute(tags, 'building:start_date') %}{% set start_date = attribute(tags, 'building:start_date') %}{% endif %}", + "{# Deprecated tags #}", + "{% if not start_date and attribute(tags, 'building:age') %}{% set start_date = attribute(tags, 'building:age') %}{% endif %}", + "{% if not start_date and attribute(tags, 'building:year_built') %}{% set start_date = attribute(tags, 'building:year_built') %}{% endif %}", + "{% if not start_date and attribute(tags, 'building:buildyear') %}{% set start_date = attribute(tags, 'building:buildyear') %}{% endif %}", + "{% if not start_date and attribute(tags, 'year_built') %}{% set start_date = attribute(tags, 'year_built') %}{% endif %}", + "{% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %}", + "", + "{% if start_date %}", + " {# equalize tagging mistakes - need to add QA messages #}", + " {# convert 1910-1911 to 1910..1911 #}{% set m = start_date|matches('^(\\d{4})-(\\d{4})$') %}{% if m %}{% set start_date = m[1] ~ '..' ~ m[2] %}{% endif %}", + " {# convert 191* to 1910s #}{% set m = start_date|matches('^(\\d{3})\\*$') %}{% if m %}{% set start_date = m[1] ~ '0s' %}{% endif %}", + "", + "", + " {% set value = start_date|osmParseDate %}", " {% if value and value[0] and value[1] %}", " {% set value = (value[1] - value[0]) / 2 + value[0] %}", " {% elseif value and value[0] %}", @@ -44,15 +58,15 @@ "{% endif %}" ], "description": [ - "{% if tags.start_date %}", - "{{ tags.start_date|osmFormatDate({ format: 'short' }) }}", + "{% if start_date %}", + "{{ start_date|osmFormatDate({ format: 'short' }) }}", "{% else %}", "{{ trans('unknown') }}", "{% endif %}" ], "popupDescription": [ - "{% if tags.start_date %}", - "{{ tags.start_date|osmFormatDate }}", + "{% if start_date %}", + "{{ start_date|osmFormatDate }}", "{% else %}", "{{ trans('unknown') }}", "{% endif %}" @@ -61,7 +75,7 @@ "listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}", "priority": [ "{% set p = 100 %}", - "{% if tags.start_date %}{% set p = p - 20 %}{% endif %}", + "{% if start_date %}{% set p = p - 20 %}{% endif %}", "{% if tags.name %}{% set p = p - 10 %}{% endif %}", "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", diff --git a/buildings-type.json b/buildings-type.json index c7c2d85..ea9eb4e 100644 --- a/buildings-type.json +++ b/buildings-type.json @@ -7,16 +7,12 @@ "pt-br": "Tipologias" }, "query": { - "16": [ - "(", - " way[building][building!=no];", - " relation[building][building!=no];", - ")" - ] + "16": "nwr[building][building!=no];" }, "feature": { "pre": [ "{% set type = tags.building|split(';')[0] %}", + "{% if tags.military %}{% set type = 'military' %}{% endif %}", "{% set color = const.other.color %}", "{% for cat, data in const %}", " {% if type in data.types %}", @@ -25,13 +21,18 @@ "{% endfor %}" ], "description": [ - "{% if tags.building == 'yes' %}", + "{% if tags.building == 'yes' and tags.military %}", + "{{ tagTrans('building', 'military') }}", + "{% elseif tags.building == 'yes' %}", "{{ keyTrans('building') }}", "{% else %}", "{{ tagTransList('building', tags.building) }}", "{% endif %}", "{% if tags.building == 'construction' and tags.construction %}", "({{ tagTransList('building', tags.construction) }})", + "{% endif %}", + "{% if tags.building in [ 'yes', 'military' ] and tags.military %}", + "({{ tagTransList('military', tags.military) }})", "{% endif %}" ], "markerSymbol": "", @@ -148,7 +149,7 @@ ] }, "agriculture": { - "name": "tag:landuse=agriculture", + "name": "tag:building=agriculture", "color": "#92e934", "types": [ "bakehouse", @@ -218,10 +219,11 @@ ] }, "military": { - "name": "tag:military", + "name": "tag:building=military", "color": "#4a7300", "types": [ - "bunker" + "bunker", + "military" ] }, "unspecified": { diff --git a/children.json b/children.json index 69fc913..fa2efec 100644 --- a/children.json +++ b/children.json @@ -81,5 +81,42 @@ " {{ tagTrans('amenity', 'toilets diaper=yes') }}", " ", "" - ] + ], + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "type": "select", + "show_default": "true", + "values": { + "playground": { + "name": "{{ tagTrans('leisure', 'playground') }}", + "query": "nwr[leisure=playground]" + }, + "indoor_play": { + "name": "{{ tagTrans('leisure', 'indoor_play') }}", + "query": "nwr[leisure=indoor_play]" + }, + "summer_camp": { + "name": "{{ tagTrans('leisure', 'summer_camp') }}", + "query": "nwr[leisure=summer_camp]" + }, + "kids_area": { + "name": "{{ keyTrans('kids_area') }}", + "query": "nwr[kids_area]" + }, + "shop_baby_goods": { + "name": "{{ tagTrans('shop', 'baby_goods') }}", + "query": "nwr[shop=baby_goods]" + }, + "shop_toys": { + "name": "{{ tagTrans('shop', 'toys') }}", + "query": "nwr[shop=toys]" + }, + "toilets": { + "name": "{{ tagTrans('amenity', 'toilets diaper=yes') }}", + "query": "nwr[amenity=toilets][diaper]" + } + } + } + } } diff --git a/communication.json b/communication.json index 83a90d3..3053b3e 100644 --- a/communication.json +++ b/communication.json @@ -130,5 +130,13 @@ "sign": "", "zoom": 16 } + }, + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "show_default": "true", + "type": "select", + "values": "{% for k, v in const %}{% endfor %}" + } } } diff --git a/craft.json b/craft.json index f9c49d4..af16569 100644 --- a/craft.json +++ b/craft.json @@ -73,5 +73,13 @@ "window_construction": "", "winery": "🍷" } + }, + "filter": { + "craft": { + "name": "{{ trans('filter:type') }}", + "type": "select", + "show_default": "true", + "values": "{% set list = [] %}{% for t, v in const.crafts %}{% endfor %}" + } } } diff --git a/culture.json b/culture.json index 630f375..226b774 100644 --- a/culture.json +++ b/culture.json @@ -121,5 +121,15 @@ " ", "{% endfor %}", "" - ] + ], + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "show_default": "true", + "query": "nwr[{{ value }}]", + "type": "select", + "values": "{% for k, v in const %}{% endfor %}", + "valueName": "{{ trans('tag:' ~ value) }}" + } + } } diff --git a/education.json b/education.json index 5b4772d..2b9887f 100644 --- a/education.json +++ b/education.json @@ -29,17 +29,13 @@ ], "14": [ "(", - "node[amenity~'^(college|university|library|school|kindergarten|language_school)$'];", - "way[amenity~'^(college|university|library|school|kindergarten|language_school)$'];", - "relation[amenity~'^(college|university|library|school|kindergarten|language_school)$'];", + "nwr[amenity~'^(college|university|library|school|kindergarten|language_school)$'];", "nwr[office~\"^(educational_institution|research)$\"];", ")" ], "16": [ "(", - "node[amenity~'^(college|university|library|school|kindergarten|public_bookcase)$'];", - "way[amenity~'^(college|university|library|school|kindergarten|public_bookcase)$'];", - "relation[amenity~'^(college|university|library|school|kindergarten|public_bookcase)$'];", + "nwr[amenity~'^(college|university|library|school|kindergarten|language_school|public_bookcase)$'];", "nwr[office~\"^(educational_institution|research)$\"];", ")" ] @@ -129,5 +125,13 @@ "sign": "", "zoom": 14 } + }, + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "show_default": "true", + "type": "select", + "values": "{% for k, v in const %}{% endfor %}" + } } } diff --git a/emergency.json b/emergency.json index 73b606d..361337c 100644 --- a/emergency.json +++ b/emergency.json @@ -96,5 +96,34 @@ "sign": "", "background": "#009262" } + }, + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "type": "select", + "show_default": "true", + "values": { + "fire_station": { + "name": "{{ tagTrans('amenity', 'fire_station') }}", + "query": "nwr[amenity=fire_station]" + }, + "hospital": { + "name": "{{ tagTrans('amenity', 'hospital') }}", + "query": "nwr[amenity=hospital]" + }, + "police": { + "name": "{{ tagTrans('amenity', 'police') }}", + "query": "nwr[amenity=police]" + }, + "emergency_phone": { + "name": "{{ tagTrans('emergency', 'phone') }}", + "query": "node[emergency=phone]" + }, + "emergency_access_point": { + "name": "{{ tagTrans('highway', 'emergency_access_point') }}", + "query": "node[highway=emergency_access_point]" + } + } + } } } diff --git a/financial.json b/financial.json index 82b3bfb..9dce980 100644 --- a/financial.json +++ b/financial.json @@ -101,5 +101,13 @@ "sign": "", "zoom": 15 } + }, + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "show_default": "true", + "type": "select", + "values": "{% for k, v in const %}{% endfor %}" + } } } diff --git a/gastro.json b/gastro.json index d838586..eaf7a12 100644 --- a/gastro.json +++ b/gastro.json @@ -19,7 +19,7 @@ "uk": "Гастрономія" }, "query": { - "16": "(node[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];way[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];relation[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];);" + "16": "(node[amenity~'^(bar|biergarten|cafe|fast_food|food_court|ice_cream|pub|restaurant)$'];way[amenity~'^(bar|biergarten|cafe|fast_food|food_court|ice_cream|pub|restaurant)$'];relation[amenity~'^(bar|biergarten|cafe|fast_food|food_court|ice_cream|pub|restaurant)$'];);" }, "feature": { "description": "{{ tagTrans('amenity', tags.amenity) }}", @@ -45,5 +45,72 @@ "" ], "markerSign": "{% if tags.amenity=='bar' %}🍸{% elseif tags.amenity=='biergarten'%}🍻{% elseif tags.amenity=='cafe' %}☕{% elseif tags.amenity=='fast_food' %}🍔{% elseif tags.amenity=='ice_cream' %}🍨{% elseif tags.amenity=='pub' %}🍺{% else %}🍴{% endif %}" + }, + "filter": { + "amenity": { + "name": "{{ trans('filter:type') }}", + "type": "select", + "show_default": "true", + "values": [ + "bar", + "biergarten", + "cafe", + "fast_food", + "food_court", + "ice_cream", + "pub", + "restaurant" + ], + "valueName": "{{ tagTrans('amenity', value) }}", + "op": "=" + }, + "cuisine_food": { + "name": "{{ keyTrans('cuisine/food') }}", + "type": "select", + "key": "cuisine", + "values": [ "barbecue", "burger", "casserole", "chicken", "couscous", "curry", "fish", "fish_and_chips", "fried_food", "friture", "gyros", "kebab", "noodle", "pasta", "pizza", "sandwich", "sausage", "seafood", "soup", "steak_house", "sub", "sushi", "tapas", "wings" ], + "valueName": "{{ tagTrans('cuisine', value) }}", + "op": "has" + }, + "cuisine_dessert": { + "name": "{{ keyTrans('cuisine/dessert') }}", + "type": "select", + "key": "cuisine", + "values": [ "bagel", "biscuit", "bougatsa", "cake", "coffee_shop", "cookie", "crepe", "dessert", "donut", "empanada", "frozen_yogurt", "gingerbread", "ice_cream", "chimney_cake", "langos", "pancake", "pastry", "petit_four", "pie", "pogacha", "poppy_seed_roll", "profiterole", "punch_cake", "savory_pancakes", "strudel", "teahouse", "waffle" ], + "valueName": "{{ tagTrans('cuisine', value) }}", + "op": "has" + }, + "cuisine_ethnicity": { + "name": "{{ keyTrans('cuisine/ethnicity') }}", + "type": "select", + "key": "cuisine", + "values": [ "afghan", "african", "american", "arab", "argentinian", "asian", "australian", "baiana", "balkan", "basque", "bavarian", "belarusan", "bolivian", "brazilian", "cantonese", "capixaba", "caribbean", "chinese", "croatian", "czech", "danish", "french", "gaucho", "german", "greek", "hawaiian", "hunan", "hungarian", "indian", "international", "iranian", "italian", "japanese", "jewish", "korean", "kyo_ryouri", "latin_american", "lebanese", "malagasy", "mediterranean", "mexican", "mineira", "new_mexican", "okinawa_ryori", "pakistani", "peruvian", "polish", "portuguese", "regional", "rhenish", "russian", "shandong", "sichuan", "spanish", "texan", "tex-mex", "thai", "turkish", "vietnamese", "westphalian" ], + "valueName": "{{ tagTrans('cuisine', value) }}", + "op": "has" + }, + "diet": { + "name": "{{ keyTrans('diet') }}", + "type": "select", + "values": { + "*": { + "name": "{{ repoTrans('Objects with diet information') }}", + "query": "nwr[~\"^diet:\"~\".\"]" + }, + "diet:vegan": {}, + "diet:vegetarian": {}, + "diet:pescetarian": {}, + "diet:lacto_vegetarian": {}, + "diet:ovo_vegetarian": {}, + "diet:fruitarian": {}, + "diet:raw": {}, + "diet:gluten_free": {}, + "diet:dairy_free": {}, + "diet:lactose_free": {}, + "diet:halal": {}, + "diet:kosher": {} + }, + "valueName": "{{ keyTrans(value) }}", + "op": "has_key_value" + } } } diff --git a/health.json b/health.json index a540782..57e3148 100644 --- a/health.json +++ b/health.json @@ -48,45 +48,209 @@ " {% set value = tags.emergency %}", "{% elseif tags.healthcare %}", " {% set key = 'healthcare' %}", - " {% set value = tags.healthcare %}", + " {% set value = tags.healthcare|split(';')[0] %}", "{% else %}", " {% set key = 'amenity' %}", " {% set value = tags.amenity %}", - "{% endif %}" + "{% endif %}", + "{% set kv = key ~ '=' ~ value %}", + "{% set found = { sign: '' } %}", + "{% for data in const %}", + " {% if kv in data.types %}{% set found = data %}{% endif %}", + "{% endfor %}" ], "description": [ - "{{ tagTrans(key, value) }}", + "{{ tagTransList(key, attribute(tags, key)) }}", "{% if attribute(tags, 'healthcare:speciality') %}", "-", "{{ tagTransList('healthcare:speciality', attribute(tags, 'healthcare:speciality')) }}", "{% endif %}" ], - "markerSign": "{{ const[key ~ '=' ~ value]|raw }}" + "markerSign": "{{ found.sign|raw }}" }, "info": [ "", - "{% for value, sign in const %}", + "{% for data in const %}", " ", - " ", - " ", + " ", + " ", " ", "{% endfor %}", "
{{ markerCircle({})|raw }}
{{ sign|raw }}
{{ tagTrans(value|split('=')[0], value|split('=')[1]) }}{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans(data.types[0]|split('=')[0], data.types[0]|split('=')[1]) }}
" ], - "const": { - "amenity=baby_hatch": "🚼", - "healthcare=blood_bank": "", - "healthcare=blood_donation": "", - "healthcare=clinic": "🏥", - "emergency=defibrillator": "", - "healthcare=dentist": "", - "healthcare=doctor": "", - "amenity=doctors": "", - "amenity=hospital": "🏥", - "healthcare=hospital": "🏥", - "amenity=nursing_home": "", - "amenity=pharmacy": "", - "amenity=social_facility": "", - "amenity=veterinary": "" + "const": [ + { + "types": [ + "amenity=hospital", + "healthcare=hospital" + ], + "sign": "" + }, + { + "types": [ + "healthcare=clinic" + ], + "sign": "" + }, + { + "types": [ + "healthcare=centre" + ], + "sign": "" + }, + { + "types": [ + "healthcare=doctor", + "amenity=doctors" + ], + "sign": "" + }, + { + "types": [ + "amenity=pharmacy", + "healthcare=pharmacy" + ], + "sign": "" + }, + { + "types": [ + "emergency=defibrillator" + ], + "sign": "" + }, + { + "types": [ + "healthcare=dentist", + "amenity=dentist" + ], + "sign": "" + }, + { + "types": [ + "amenity=baby_hatch" + ], + "sign": "🚼" + }, + { + "types": [ + "healthcare=blood_bank" + ], + "sign": "" + }, + { + "types": [ + "healthcare=blood_donation" + ], + "sign": "" + }, + { + "types": [ + "amenity=nursing_home" + ] + }, + { + "types": [ + "amenity=social_facility" + ], + "sign": "" + }, + { + "types": [ + "amenity=veterinary" + ], + "sign": "" + }, + { + "types": [ + "healthcare=physiotherapist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=psychotherapist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=alternative" + ], + "sign": "" + }, + { + "types": [ + "healthcare=audiologist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=birthing_center" + ], + "sign": "" + }, + { + "types": [ + "healthcare=dialysis" + ], + "sign": "" + }, + { + "types": [ + "healthcare=laboratory" + ], + "sign": "" + }, + { + "types": [ + "healthcare=midwife" + ], + "sign": "" + }, + { + "types": [ + "healthcare=nutrition_counseling" + ], + "sign": "" + }, + { + "types": [ + "healthcare=occupational_therapist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=optometrist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=podiatrist" + ], + "sign": "" + }, + { + "types": [ + "healthcare=rehabilitation" + ], + "sign": "" + }, + { + "types": [ + "healthcare=speech_therapist" + ], + "sign": "" + } + ], + "filter": { + "type": { + "name": "{{ trans('filter:type') }}", + "show_default": "true", + "type": "select", + "values": "{% for data in const %}{% endfor %}" + } } } diff --git a/historic.json b/historic.json index 0042fc1..e9396fb 100644 --- a/historic.json +++ b/historic.json @@ -32,11 +32,25 @@ "node[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine|wayside_chapel)$\"];", "way[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine|wayside_chapel)$\"];", "relation[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine|wayside_chapel)$\"];", + "node[memorial~\"^(flood_mark|high_water_mark)$\"];", + "node[\"memorial:type\"~\"^(flood_mark|high_water_mark)$\"];", + "node[flood_mark];", ")" ] }, "feature": { - "description": "{{ tagTransList('historic', tags.historic) }}", + "description": [ + "{% set historic = tags.historic %}", + "{% if attribute(tags, 'memorial') == 'high_water_mark' or attribute(tags, 'memorial:type') == 'high_water_mark' or attribute(tags, 'memorial') == 'flood_mark' or attribute(tags, 'memorial:type') == 'flood_mark' or tags.historic == 'highwater_mark' or (tags.historic != 'flood_mark' and tags.flood_mark) %}", + "{{ tagTrans('historic', 'flood_mark') }}", + "{{ debug(id ~ ': Deprecated tagging. Please use historic=flood_mark.') }}", + "{% set historic = 'flood_mark' %}", + "{% else %}", + "{{ tagTransList('historic', tags.historic) }}", + "{% endif %}", + "", + "{% if tags.flood_mark and tags.flood_mark != 'yes' %}({{ tagTrans('flood_mark', tags.flood_mark) }}){% endif %}" + ], "body": [ "