From 5eeb5b711df87bc5c3428b60c13a8835dcf44ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 9 Nov 2017 10:24:29 +0100 Subject: [PATCH] Split multiline strings into string arrays --- administrative.json | 42 ++++++++++++++++++--- agriculture.json | 8 +++- buildings.json | 21 ++++++++++- car_amenities.json | 21 +++++++++-- car_maxspeed.json | 38 ++++++++++++++++++- construction.json | 21 ++++++++++- culture.json | 21 ++++++++++- cycle_amenities.json | 72 +++++++++++++++++++++++++++++++++--- emergency.json | 19 ++++++++-- financial.json | 16 +++++++- gastro.json | 10 ++++- health.json | 44 ++++++++++++++++++++-- hiking_routes.json | 7 +++- historic.json | 16 +++++++- leisure.json | 15 +++++++- military.json | 32 ++++++++++++++-- natural.json | 27 ++++++++++++-- package.json | 42 ++++++++++----------- places.json | 4 +- power.json | 6 ++- pt_amenities.json | 21 ++++++++++- pt_routes.json | 6 ++- pt_stops.json | 25 ++++++++++++- railway-electrification.json | 53 ++++++++++++++++++++++++-- railway-infrastructure.json | 33 +++++++++++++++-- religion.json | 40 ++++++++++++++++++-- residential.json | 16 +++++++- resources.json | 21 ++++++++++- sport.json | 5 ++- tourism_attractions.json | 8 +++- tourism_services.json | 8 +++- walk_amenities.json | 45 ++++++++++++++++++++-- waste.json | 47 +++++++++++++++++++++-- wikipedia.json | 49 ++++++++++++++++++++++-- 34 files changed, 755 insertions(+), 104 deletions(-) diff --git a/administrative.json b/administrative.json index c167402..c248b19 100644 --- a/administrative.json +++ b/administrative.json @@ -15,12 +15,42 @@ "ru": "Административные границы" }, "query": { - "3": "(\nway[admin_level=2];\nrelation[admin_level=2];\n)", - "6": "(\nway[admin_level~\"^(2|3)$\"];\nrelation[admin_level~\"^(2|3)$\"];\n)", - "11": "(\nway[admin_level~\"^(2|3|4|5)$\"];\nrelation[admin_level~\"^(2|3|4|5)$\"];\n)", - "13": "(\nway[admin_level~\"^(2|3|4|5|6|7)$\"];\nrelation[admin_level~\"^(2|3|4|5|6|7)$\"];\n)", - "15": "(\nway[admin_level~\"^(2|3|4|5|6|7|8|9)$\"];\nrelation[admin_level~\"^(2|3|4|5|6|7|8|9)$\"];\n)", - "16": "(\nway[admin_level~\"^(2|3|4|5|6|7|8|9|10|11)$\"];\nrelation[admin_level~\"^(2|3|4|5|6|7|8|9|10|11)$\"];\n)" + "3": [ + "(", + "way[admin_level=2];", + "relation[admin_level=2];", + ")" + ], + "6": [ + "(", + "way[admin_level~\"^(2|3)$\"];", + "relation[admin_level~\"^(2|3)$\"];", + ")" + ], + "11": [ + "(", + "way[admin_level~\"^(2|3|4|5)$\"];", + "relation[admin_level~\"^(2|3|4|5)$\"];", + ")" + ], + "13": [ + "(", + "way[admin_level~\"^(2|3|4|5|6|7)$\"];", + "relation[admin_level~\"^(2|3|4|5|6|7)$\"];", + ")" + ], + "15": [ + "(", + "way[admin_level~\"^(2|3|4|5|6|7|8|9)$\"];", + "relation[admin_level~\"^(2|3|4|5|6|7|8|9)$\"];", + ")" + ], + "16": [ + "(", + "way[admin_level~\"^(2|3|4|5|6|7|8|9|10|11)$\"];", + "relation[admin_level~\"^(2|3|4|5|6|7|8|9|10|11)$\"];", + ")" + ] }, "feature": { "description": "{{ tagTrans('admin_level', tags.admin_level) }}", diff --git a/agriculture.json b/agriculture.json index dbeb6c3..ea8177c 100644 --- a/agriculture.json +++ b/agriculture.json @@ -16,7 +16,13 @@ "ru": "Сельское хозяйство" }, "query": { - "13": "(\nnode[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];\nway[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];\nrelation[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];\n)" + "13": [ + "(", + "node[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];", + "way[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];", + "relation[landuse~\"^(allotments|farm|farmland|farmyard|greenhouse_horticulture|orchard|vineyard)$\"];", + ")" + ] }, "feature": { "description": "{{ tagTrans('landuse', tags.landuse) }}" diff --git a/buildings.json b/buildings.json index 9386889..432ef01 100644 --- a/buildings.json +++ b/buildings.json @@ -5,10 +5,27 @@ "de": "Gebäude" }, "query": { - "16": "(\n way[building];\n relation[building];\n)" + "16": [ + "(", + " way[building];", + " relation[building];", + ")" + ] }, "feature": { - "priority": "{% set p = 100 %}\n{% if tags.name %}{% set p = p - 10 %}{% endif %}\n{% if tags.amenity %}{% set p = p - 1 %}{% endif %}\n{% if tags.historic %}{% set p = p - 1 %}{% endif %}\n{% if tags.culture %}{% set p = p - 1 %}{% endif %}\n{% if tags.highway %}{% set p = p - 1 %}{% endif %}\n{% if tags.railway %}{% set p = p - 1 %}{% endif %}\n{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}\n{% if tags.amenity %}{% set p = p - 1 %}{% endif %}\n{% if tags.tourism %}{% set p = p - 1 %}{% endif %}\n{{ p }}", + "priority": [ + "{% set p = 100 %}", + "{% if tags.name %}{% set p = p - 10 %}{% endif %}", + "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", + "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", + "{% if tags.culture %}{% set p = p - 1 %}{% endif %}", + "{% if tags.highway %}{% set p = p - 1 %}{% endif %}", + "{% if tags.railway %}{% set p = p - 1 %}{% endif %}", + "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}", + "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", + "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}", + "{{ p }}" + ], "markerSign": null, "style": { "fillColor": "#000000", diff --git a/car_amenities.json b/car_amenities.json index b59113c..88efd27 100644 --- a/car_amenities.json +++ b/car_amenities.json @@ -13,11 +13,26 @@ "uk": "Amenities" }, "query": { - "13": "(\nnode[amenity~\"^(car_rental|car_sharing|fuel)$\"];\nway[amenity~\"^(car_rental|car_sharing|fuel)$\"];\nrelation[amenity~\"^(car_rental|car_sharing|fuel)$\"];\n)", - "16": "(\nnode[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];\nway[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];\nrelation[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];\n)" + "13": [ + "(", + "node[amenity~\"^(car_rental|car_sharing|fuel)$\"];", + "way[amenity~\"^(car_rental|car_sharing|fuel)$\"];", + "relation[amenity~\"^(car_rental|car_sharing|fuel)$\"];", + ")" + ], + "16": [ + "(", + "node[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];", + "way[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];", + "relation[amenity~\"^(car_rental|car_sharing|car_wash|charging_station|fuel|motorcycle_parking|parking)$\"];", + ")" + ] }, "feature": { - "pre": "{% set key = 'amenity' %}\n{% set value = tags.amenity %}", + "pre": [ + "{% set key = 'amenity' %}", + "{% set value = tags.amenity %}" + ], "description": "{{ tagTrans(key, value) }}", "markerSign": "{{ const[value] }}" }, diff --git a/car_maxspeed.json b/car_maxspeed.json index 2dc4d2d..4d1c3ca 100644 --- a/car_maxspeed.json +++ b/car_maxspeed.json @@ -10,8 +10,42 @@ "17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];" }, "feature": { - "pre": "{% if tags.maxspeed is not defined %}\n{% set maxspeedKmh = null %}\n{% set maxspeed = null %}\n{% set unit = null %}\n{% else %}\n\n{% if tags.maxspeed|matches(\"^[0-9]+$\") %}\n{% set maxspeedKmh = tags.maxspeed %}\n{% set maxspeed = tags.maxspeed %}\n{% set unit = \"km/h\" %}\n{% endif %}\n\n\n{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}\n{% if m %}\n{% set maxspeedKmh = m[1] * 1.60934 %}\n{% set maxspeed = m[1] %}\n{% set unit = \"mph\" %}\n{% endif %}\n\n{% endif %}\n\n{% if not maxspeedKmh %}\n{% set color = \"#404040\" %}\n{% else %}\n{% set color = colorInterpolate([ 'green', 'orange', 'red' ], maxspeedKmh / 150) %}\n{% endif %}", - "description": "{% if maxspeed %}\n{{ maxspeed }} {{ unit }}\n{% else %}\n{{ trans('unknown') }}\n{% endif %}", + "pre": [ + "{% if tags.maxspeed is not defined %}", + "{% set maxspeedKmh = null %}", + "{% set maxspeed = null %}", + "{% set unit = null %}", + "{% else %}", + "", + "{% if tags.maxspeed|matches(\"^[0-9]+$\") %}", + "{% set maxspeedKmh = tags.maxspeed %}", + "{% set maxspeed = tags.maxspeed %}", + "{% set unit = \"km/h\" %}", + "{% endif %}", + "", + "", + "{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}", + "{% if m %}", + "{% set maxspeedKmh = m[1] * 1.60934 %}", + "{% set maxspeed = m[1] %}", + "{% set unit = \"mph\" %}", + "{% endif %}", + "", + "{% endif %}", + "", + "{% if not maxspeedKmh %}", + "{% set color = \"#404040\" %}", + "{% else %}", + "{% set color = colorInterpolate([ 'green', 'orange', 'red' ], maxspeedKmh / 150) %}", + "{% endif %}" + ], + "description": [ + "{% if maxspeed %}", + "{{ maxspeed }} {{ unit }}", + "{% else %}", + "{{ trans('unknown') }}", + "{% endif %}" + ], "style": { "color": "{{ color }}" }, diff --git a/construction.json b/construction.json index 37d1abe..60b6785 100644 --- a/construction.json +++ b/construction.json @@ -12,10 +12,27 @@ "ru": "Места строительства" }, "query": { - "13": "(\nnode[landuse~\"^(brownfield|greenfield|construction|)$\"];\nway[landuse~\"^(brownfield|greenfield|construction|)$\"];\nrelation[landuse~\"^(brownfield|greenfield|construction|)$\"];\nnode[highway~\"^(construction)$\"];\nway[highway~\"^(construction)$\"];\nrelation[highway~\"^(construction)$\"];\n)" + "13": [ + "(", + "node[landuse~\"^(brownfield|greenfield|construction|)$\"];", + "way[landuse~\"^(brownfield|greenfield|construction|)$\"];", + "relation[landuse~\"^(brownfield|greenfield|construction|)$\"];", + "node[highway~\"^(construction)$\"];", + "way[highway~\"^(construction)$\"];", + "relation[highway~\"^(construction)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.highway == 'construction' %}\n{% set key = 'highway' %}\n{% set value = tags.highway %}\n{% else %}\n{% set key = 'landuse' %}\n{% set value = tags.landuse %}\n{% endif %}", + "pre": [ + "{% if tags.highway == 'construction' %}", + "{% set key = 'highway' %}", + "{% set value = tags.highway %}", + "{% else %}", + "{% set key = 'landuse' %}", + "{% set value = tags.landuse %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}" } } diff --git a/culture.json b/culture.json index 95c723d..62bc7e4 100644 --- a/culture.json +++ b/culture.json @@ -20,10 +20,27 @@ "uk": "Культура " }, "query": { - "13": "(\nnode[amenity~\"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$\"];\nway[amenity~\"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$\"];\nrelation[amenity~\"^(arts_centre|cinema|community_centre|fountain|studio|theatre)$\"];\nnode[tourism~\"^(artwork|gallery|museum|theme_park)$\"];\nway[tourism~\"^(artwork|gallery|museum|theme_park)$\"];\nrelation[tourism~\"^(artwork|gallery|museum|theme_park)$\"];\n)" + "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)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.amenity in [ 'arts_centre', 'cinema', 'community_centre', 'fountain', 'studio', 'theatre' ] %}\n{% set key = 'amenity' %}\n{% set value = tags.amenity %}\n{% elseif tags.tourism %}\n{% set key = 'tourism' %}\n{% set value = tags.tourism %}\n{% endif %}", + "pre": [ + "{% if tags.amenity in [ 'arts_centre', 'cinema', 'community_centre', 'fountain', 'studio', 'theatre' ] %}", + "{% set key = 'amenity' %}", + "{% set value = tags.amenity %}", + "{% elseif tags.tourism %}", + "{% set key = 'tourism' %}", + "{% set value = tags.tourism %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}", "markerSign": "{{ const[value] }}" }, diff --git a/cycle_amenities.json b/cycle_amenities.json index b1c874c..765554b 100644 --- a/cycle_amenities.json +++ b/cycle_amenities.json @@ -5,16 +5,76 @@ "de": "Einrichtungen" }, "query": { - "13": "(\nnode[amenity~\"^(bicycle_rental)$\"];\nway[amenity~\"^(bicycle_rental)$\"];\nrelation[amenity~\"^(bicycle_rental)$\"];\nnode[shop~\"^(bicycle)$\"];\nway[shop~\"^(bicycle)$\"];\nrelation[shop~\"^(bicycle)$\"];\n)", - "16": "(\nnode[amenity~\"^(bicycle_.*|compressed_air)$\"];\nway[amenity~\"^(bicycle_.*|compressed_air)$\"];\nrelation[amenity~\"^(bicycle_.*|compressed_air)$\"];\nnode[shop~\"^(bicycle)$\"];\nway[shop~\"^(bicycle)$\"];\nrelation[shop~\"^(bicycle)$\"];\nnode[\"monitoring:bicycle\"];\nway[\"monitoring:bicycle\"];\nrelation[\"monitoring:bicycle\"];\nnode[vending~\"^(bicycle_tube)$\"];\nway[vending~\"^(bicycle_tube)$\"];\nrelation[vending~\"^(bicycle_tube)$\"];\n)\n" + "13": [ + "(", + "node[amenity~\"^(bicycle_rental)$\"];", + "way[amenity~\"^(bicycle_rental)$\"];", + "relation[amenity~\"^(bicycle_rental)$\"];", + "node[shop~\"^(bicycle)$\"];", + "way[shop~\"^(bicycle)$\"];", + "relation[shop~\"^(bicycle)$\"];", + ")" + ], + "16": [ + "(", + "node[amenity~\"^(bicycle_.*|compressed_air)$\"];", + "way[amenity~\"^(bicycle_.*|compressed_air)$\"];", + "relation[amenity~\"^(bicycle_.*|compressed_air)$\"];", + "node[shop~\"^(bicycle)$\"];", + "way[shop~\"^(bicycle)$\"];", + "relation[shop~\"^(bicycle)$\"];", + "node[\"monitoring:bicycle\"];", + "way[\"monitoring:bicycle\"];", + "relation[\"monitoring:bicycle\"];", + "node[vending~\"^(bicycle_tube)$\"];", + "way[vending~\"^(bicycle_tube)$\"];", + "relation[vending~\"^(bicycle_tube)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.shop in [ 'bicycle' ] %}\n {% set key = 'shop' %}\n {% set value = tags.shop %}\n{% elseif attribute(tags, \"monitoring:bicycle\") %}\n {% set key = 'man_made' %}\n {% set value = 'monitoring_station' %}\n{% elseif tags.vending in [ 'bicycle_tube' ] %}\n {% set key = 'vending' %}\n {% set value = tags.vending %}\n{% else %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}\n\n{% set constIndex = (key ~ \"=\" ~ value) %}", + "pre": [ + "{% if tags.shop in [ 'bicycle' ] %}", + " {% 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' ] %}", + " {% set key = 'vending' %}", + " {% set value = tags.vending %}", + "{% else %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% endif %}", + "", + "{% set constIndex = (key ~ \"=\" ~ value) %}" + ], "description": "{{ tagTrans(key, value) }}", - "body": "{% if tags.capacity %}\n {{ keyTrans('capacity') }}: {{ tags.capacity }}\n{% endif %}", + "body": [ + "{% if tags.capacity %}", + " {{ keyTrans('capacity') }}: {{ tags.capacity }}", + "{% endif %}" + ], "markerSign": "{{ const[constIndex]['sign'] }}", - "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}\n\n{% if tags.capacity %}({{ tags.capacity }}){% endif %}", - "priority": "{% if const[constIndex] and const[constIndex]['priority']['capacity'] %}\n {% set max=const[constIndex]['priority']['default'] %}\n {% for v in const[constIndex]['priority']['capacity'] %}\n {% if tags.capacity >= v[0] %}{% set max=v[1] %}{% endif %}\n {% endfor %}\n {{ max }}\n{% elseif const[constIndex] is defined %}\n{{ const[constIndex]['priority'] }}\n{% else %}\n10\n{% endif %}" + "title": [ + "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}", + "", + "{% if tags.capacity %}({{ tags.capacity }}){% endif %}" + ], + "priority": [ + "{% if const[constIndex] and const[constIndex]['priority']['capacity'] %}", + " {% set max=const[constIndex]['priority']['default'] %}", + " {% for v in const[constIndex]['priority']['capacity'] %}", + " {% if tags.capacity >= v[0] %}{% set max=v[1] %}{% endif %}", + " {% endfor %}", + " {{ max }}", + "{% elseif const[constIndex] is defined %}", + "{{ const[constIndex]['priority'] }}", + "{% else %}", + "10", + "{% endif %}" + ] }, "const": { "shop=bicycle": { diff --git a/emergency.json b/emergency.json index 6bbb3b6..1d82e0b 100644 --- a/emergency.json +++ b/emergency.json @@ -18,12 +18,25 @@ "uk": "Швидка допомога" }, "query": { - "11": "(node[amenity~\"^(fire_station|hospital)$\"];\nway[amenity~\"^(fire_station|hospital)$\"];\nrelation[amenity~\"^(fire_station|hospital)$\"])", - "13": "(node[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"];\nway[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"];\nrelation[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"])" + "11": [ + "(node[amenity~\"^(fire_station|hospital)$\"];", + "way[amenity~\"^(fire_station|hospital)$\"];", + "relation[amenity~\"^(fire_station|hospital)$\"])" + ], + "13": [ + "(node[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"];", + "way[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"];", + "relation[amenity~\"^(fire_station|hospital|police|emergency_phone)$\"])" + ] }, "feature": { "description": "{{ tagTrans('amenity', tags.amenity) }}", - "markerSign": "{% set data = const[tags.amenity] %}\n{% if data %}\n{{ data.sign }}\n{% endif %}" + "markerSign": [ + "{% set data = const[tags.amenity] %}", + "{% if data %}", + "{{ data.sign }}", + "{% endif %}" + ] }, "const": { "fire_station": { diff --git a/financial.json b/financial.json index c2c683f..61f6a1c 100644 --- a/financial.json +++ b/financial.json @@ -16,8 +16,20 @@ "uk": "Фінанси" }, "query": { - "14": "(\nnode[amenity~\"^(bank)$\"];\nway[amenity~\"^(bank)$\"];\nrelation[amenity~\"^(bank)$\"]\n)", - "15": "(\nnode[amenity~\"^(bank|bureau_de_change|atm)$\"];\nway[amenity~\"^(bank|bureau_de_change|atm)$\"];\nrelation[amenity~\"^(bank|bureau_de_change|atm)$\"]\n)" + "14": [ + "(", + "node[amenity~\"^(bank)$\"];", + "way[amenity~\"^(bank)$\"];", + "relation[amenity~\"^(bank)$\"]", + ")" + ], + "15": [ + "(", + "node[amenity~\"^(bank|bureau_de_change|atm)$\"];", + "way[amenity~\"^(bank|bureau_de_change|atm)$\"];", + "relation[amenity~\"^(bank|bureau_de_change|atm)$\"]", + ")" + ] }, "feature": { "description": "{{ tagTrans('amenity', tags.amenity) }}", diff --git a/gastro.json b/gastro.json index 739287d..e31e3a2 100644 --- a/gastro.json +++ b/gastro.json @@ -21,7 +21,15 @@ }, "feature": { "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 %}", - "body": "", + "body": [ + "" + ], "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/health.json b/health.json index ea16882..e7ab82b 100644 --- a/health.json +++ b/health.json @@ -16,12 +16,48 @@ "uk": "Здоров'я" }, "query": { - "11": "(\nnode[amenity~\"^(hospital)$\"];\nway[amenity~\"^(hospital)$\"];\nrelation[amenity~\"^(hospital)$\"];\nnode[healthcare~\"^(hospital|clinic)$\"];\nway[healthcare~\"^(hospital|clinic)$\"];\nrelation[healthcare~\"^(hospital|clinic)$\"];\n)", - "14": "(\nnode[amenity~\"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$\"];\nnode[emergency=defibrillator];\nway[amenity~\"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$\"];\nrelation[amenity~\"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$\"];\nnode[healthcare];\nway[healthcare];\nrelation[healthcare];\n)" + "11": [ + "(", + "node[amenity~\"^(hospital)$\"];", + "way[amenity~\"^(hospital)$\"];", + "relation[amenity~\"^(hospital)$\"];", + "node[healthcare~\"^(hospital|clinic)$\"];", + "way[healthcare~\"^(hospital|clinic)$\"];", + "relation[healthcare~\"^(hospital|clinic)$\"];", + ")" + ], + "14": [ + "(", + "node[amenity~\"^(baby_hatch|clinic|dentist|doctors|hospital|nursing_home|pharmacy|social_facility|veterinary)$\"];", + "node[emergency=defibrillator];", + "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];", + ")" + ] }, "feature": { - "pre": "{% if tags.emergency in [ 'defibrillator' ] %}\n {% set key = 'emergency' %}\n {% set value = tags.emergency %}\n{% elseif tags.healthcare %}\n {% set key = 'healthcare' %}\n {% set value = tags.healthcare %}\n{% else %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}\n", - "description": "{{ tagTrans(key, value) }}\n{% if attribute(tags, 'healthcare:speciality') %}\n-\n{{ tagTransList('healthcare:speciality', attribute(tags, 'healthcare:speciality')) }}\n{% endif %}", + "pre": [ + "{% if tags.emergency in [ 'defibrillator' ] %}", + " {% set key = 'emergency' %}", + " {% set value = tags.emergency %}", + "{% elseif tags.healthcare %}", + " {% set key = 'healthcare' %}", + " {% set value = tags.healthcare %}", + "{% else %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% endif %}" + ], + "description": [ + "{{ tagTrans(key, value) }}", + "{% if attribute(tags, 'healthcare:speciality') %}", + "-", + "{{ tagTransList('healthcare:speciality', attribute(tags, 'healthcare:speciality')) }}", + "{% endif %}" + ], "markerSign": "{{ const[value] }}" }, "const": { diff --git a/hiking_routes.json b/hiking_routes.json index 7e04e78..3c21642 100644 --- a/hiking_routes.json +++ b/hiking_routes.json @@ -12,7 +12,12 @@ }, "feature": { "description": "{{ tagTrans('network', tags.network) }}", - "priority": "{% set network_data = const[tags.network] %}\n{% if network_data %}\n{{ network_data.priority }}\n{% endif %}" + "priority": [ + "{% set network_data = const[tags.network] %}", + "{% if network_data %}", + "{{ network_data.priority }}", + "{% endif %}" + ] }, "const": { "iwn": { diff --git a/historic.json b/historic.json index 463636c..efe9e1c 100644 --- a/historic.json +++ b/historic.json @@ -18,8 +18,20 @@ "uk": "Історія" }, "query": { - "11": "(\nnode[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];\nway[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];\nrelation[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];\n)", - "14": "(\nnode[historic];\nway[historic];\nrelation[historic];\n)" + "11": [ + "(", + "node[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", + "way[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", + "relation[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", + ")" + ], + "14": [ + "(", + "node[historic];", + "way[historic];", + "relation[historic];", + ")" + ] }, "feature": { "description": "{{ tagTransList('historic', tags.historic) }}", diff --git a/leisure.json b/leisure.json index dd15a7f..f719e1a 100644 --- a/leisure.json +++ b/leisure.json @@ -15,9 +15,20 @@ "uk": "Дозвілля" }, "query": { - "15": "(\nnode[leisure];\nway[leisure];\nrelation[leisure];\n)" + "15": [ + "(", + "node[leisure];", + "way[leisure];", + "relation[leisure];", + ")" + ] }, "feature": { - "description": "{{ tagTrans('leisure', tags.leisure) }}\n{% if tags.leisure == 'pitch' and tags.sport %}\n- {{ tagTransList('sport', tags.sport) }}\n{% endif %}" + "description": [ + "{{ tagTrans('leisure', tags.leisure) }}", + "{% if tags.leisure == 'pitch' and tags.sport %}", + "- {{ tagTransList('sport', tags.sport) }}", + "{% endif %}" + ] } } diff --git a/military.json b/military.json index 6758142..c1207f6 100644 --- a/military.json +++ b/military.json @@ -15,11 +15,37 @@ "ru": "Вооружённые силы" }, "query": { - "11": "(\nnode[military~\"^(airfield|danger_area)$\"];\nnode[landuse=military];\nway[military~\"^(airfield|danger_area)$\"];\nway[landuse=military];\nrelation[military~\"^(airfield|danger_area)$\"];\nrelation[landuse=military];\n)", - "14": "(\nnode[military];\nnode[landuse=military];\nway[military];\nway[landuse=military];\nrelation[military];\nrelation[landuse=military];\n)" + "11": [ + "(", + "node[military~\"^(airfield|danger_area)$\"];", + "node[landuse=military];", + "way[military~\"^(airfield|danger_area)$\"];", + "way[landuse=military];", + "relation[military~\"^(airfield|danger_area)$\"];", + "relation[landuse=military];", + ")" + ], + "14": [ + "(", + "node[military];", + "node[landuse=military];", + "way[military];", + "way[landuse=military];", + "relation[military];", + "relation[landuse=military];", + ")" + ] }, "feature": { - "pre": "{% if tags.military %}\n {% set key = 'military' %}\n {% set value = tags.military %}\n{% else %}\n {% set key = 'landuse' %}\n {% set value = tags.landuse %}\n{% endif %}", + "pre": [ + "{% if tags.military %}", + " {% set key = 'military' %}", + " {% set value = tags.military %}", + "{% else %}", + " {% set key = 'landuse' %}", + " {% set value = tags.landuse %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}" } } diff --git a/natural.json b/natural.json index 925034b..fec35a4 100644 --- a/natural.json +++ b/natural.json @@ -15,12 +15,31 @@ "uk": "Природне середовище" }, "query": { - "9": "(\nnode[natural~\"^(peak|volcano)$\"];\n)", - "16": "(\nnode[natural];\nway[natural];\nrelation[natural];\n)", - "13": "(\nnode[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];\nway[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];\nrelation[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];\n)" + "9": [ + "(", + "node[natural~\"^(peak|volcano)$\"];", + ")" + ], + "16": [ + "(", + "node[natural];", + "way[natural];", + "relation[natural];", + ")" + ], + "13": [ + "(", + "node[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];", + "way[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];", + "relation[natural~\"^(peak|volcano|wood|scrub|heath|grassland|fell|bare_rock|scree|shingle|sand|mud|water|wetland|glacier|bay|cape|beach|coastline|spring|hot_spring|geyser|valley|ridge|arete|cliff|saddle|rock|stone|sinkhole|cave_entrance)$\"];", + ")" + ] }, "feature": { - "title": "{{ localizedTag(tags, 'name') | default(trans('unnamed')) }}\n{% if tags.natural == 'peak' and tags.ele %}({{ tags.ele }}m){% endif %}", + "title": [ + "{{ localizedTag(tags, 'name') | default(trans('unnamed')) }}", + "{% if tags.natural == 'peak' and tags.ele %}({{ tags.ele }}m){% endif %}" + ], "description": "{{ tagTrans('natural', tags.natural) }}" } } diff --git a/package.json b/package.json index 6f6115d..98688ec 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,23 @@ { - "name": "openstreetbrowser-categories-main", - "version": "0.0.1", - "description": "Categories for OpenStreetBrowser", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/plepe/openstreetbrowser-categories-main.git" - }, - "keywords": [ - "openstreetbrowser", - "openstreetmap", - "osm" - ], - "author": "Stephan Bösch-Plepelits ", - "license": "CC-BY-SA-2.0", - "bugs": { - "url": "https://github.com/plepe/openstreetbrowser-categories-main/issues" - }, - "homepage": "https://github.com/plepe/openstreetbrowser-categories-main#readme" + "name": "openstreetbrowser-categories-main", + "version": "0.0.1", + "description": "Categories for OpenStreetBrowser", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/plepe/openstreetbrowser-categories-main.git" + }, + "keywords": [ + "openstreetbrowser", + "openstreetmap", + "osm" + ], + "author": "Stephan Bösch-Plepelits ", + "license": "CC-BY-SA-2.0", + "bugs": { + "url": "https://github.com/plepe/openstreetbrowser-categories-main/issues" + }, + "homepage": "https://github.com/plepe/openstreetbrowser-categories-main#readme" } diff --git a/places.json b/places.json index 27d9fdb..bdf0a5d 100644 --- a/places.json +++ b/places.json @@ -29,7 +29,9 @@ }, "feature": { "title": "{% set loc_name = localizedTag(tags, 'name') %}{{ loc_name }}{% if loc_name != tags.name %} ({{ tags.name }}){% endif %}", - "body": "{% if tags.population %}{{ keyTrans('population') }}: {{ tags.population }}{% endif %} \n", + "body": [ + "{% if tags.population %}{{ keyTrans('population') }}: {{ tags.population }}{% endif %} " + ], "description": "{{ tagTrans('place', tags.place) }}", "priority": "{% set priorities = { 'continent': 0, 'country': 1, 'state': 2, 'region': 3, 'city': 4, 'town': 5, 'village': 6, 'suburb': 7, 'hamlet': 8, 'quarter': 9, neighbourhood: 10, 'isolated_dwelling': 11, 'farm': 12 } %}{{ priorities[tags.place] }}" } diff --git a/power.json b/power.json index 5ce1bc3..f0e353e 100644 --- a/power.json +++ b/power.json @@ -22,7 +22,11 @@ }, "feature": { "markerSign": null, - "body": "{% set x='generator:source' %}{% if tags[x] %}
{{ keyTrans('generator:source') }}: {{ tagTransList('generator:source', tags[x]) }}{% endif %}\n{% set x='generator:method' %}{% if tags[x] %}
{{ keyTrans('generator:method') }}: {{ tagTransList('generator:method', tags[x]) }}{% endif %}\n{% set x='generator:type' %}{% if tags[x] %}
{{ tagTransList('generator:type') }}: {{ tagTrans('generator:type', tags[x]) }}{% endif %}", + "body": [ + "{% set x='generator:source' %}{% if tags[x] %}
{{ keyTrans('generator:source') }}: {{ tagTransList('generator:source', tags[x]) }}{% endif %}", + "{% set x='generator:method' %}{% if tags[x] %}
{{ keyTrans('generator:method') }}: {{ tagTransList('generator:method', tags[x]) }}{% endif %}", + "{% set x='generator:type' %}{% if tags[x] %}
{{ tagTransList('generator:type') }}: {{ tagTrans('generator:type', tags[x]) }}{% endif %}" + ], "description": "{{ tagTrans('power', tags.power) }}{% set x='generator:source' %}{% if tags[x] %}, {{ tagTransList('generator:source', tags[x]) }}{% endif %}", "priority": "{% if tags.power == 'plant' %}0{% elseif tags.power == 'generator' or tags.power == 'line' %}1{% elseif tags.power == 'substation' %}2{% else %}3{% endif %}", "popupDescription": "{{ tagTrans('power', tags.power) }}" diff --git a/pt_amenities.json b/pt_amenities.json index 861b69c..72a500b 100644 --- a/pt_amenities.json +++ b/pt_amenities.json @@ -13,10 +13,27 @@ "uk": "Amenities" }, "query": { - "14": "(\nnode[amenity~\"^(taxi|ticket_counter)$\"];\nway[amenity~\"^(taxi|ticket_counter)$\"];\nrelation[amenity~\"^(taxi|ticket_counter)$\"];\nnode[railway~\"^(subway_entrance)$\"];\nway[railway~\"^(subway_entrance)$\"];\nrelation[railway~\"^(subway_entrance)$\"];\n)" + "14": [ + "(", + "node[amenity~\"^(taxi|ticket_counter)$\"];", + "way[amenity~\"^(taxi|ticket_counter)$\"];", + "relation[amenity~\"^(taxi|ticket_counter)$\"];", + "node[railway~\"^(subway_entrance)$\"];", + "way[railway~\"^(subway_entrance)$\"];", + "relation[railway~\"^(subway_entrance)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.railway == 'subway_entrance' %}\n {% set key = 'railway' %}\n {% set value = tags.railway %}\n{% else %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}", + "pre": [ + "{% if tags.railway == 'subway_entrance' %}", + " {% set key = 'railway' %}", + " {% set value = tags.railway %}", + "{% else %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}", "markerSign": "{{ const[value] }}" }, diff --git a/pt_routes.json b/pt_routes.json index 77fc687..d296878 100644 --- a/pt_routes.json +++ b/pt_routes.json @@ -9,6 +9,10 @@ }, "feature": { "description": "{{ tagTrans('route', tags.route) }}", - "title": "{% if tags.ref %}{{ tags.ref }} - {% endif %}\n\n{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}" + "title": [ + "{% if tags.ref %}{{ tags.ref }} - {% endif %}", + "", + "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}" + ] } } diff --git a/pt_stops.json b/pt_stops.json index e328115..bdb63ed 100644 --- a/pt_stops.json +++ b/pt_stops.json @@ -17,10 +17,31 @@ "uk": "Зупинки та станції" }, "query": { - "14": "(\nnode[railway~\"^(station|halt|tram_stop|platform)$\"];\nway[railway~\"^(station|platform)$\"];\nnode[highway~\"^(bus_stop|platform)$\"];\nway[highway~\"^(platform)$\"];\nnode[public_transport~\"^(stop_position|platform)$\"];\nway[public_transport~\"^(platform)$\"];\nnode[amenity~\"^(ferry_terminal|bus_station)$\"];\n)" + "14": [ + "(", + "node[railway~\"^(station|halt|tram_stop|platform)$\"];", + "way[railway~\"^(station|platform)$\"];", + "node[highway~\"^(bus_stop|platform)$\"];", + "way[highway~\"^(platform)$\"];", + "node[public_transport~\"^(stop_position|platform)$\"];", + "way[public_transport~\"^(platform)$\"];", + "node[amenity~\"^(ferry_terminal|bus_station)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.amenity in [ 'ferry_terminal', 'bus_station' ] %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% elseif tags.railway == 'platform' or tags.highway == 'platform' or tags.public_transport == 'platform' %}\n {% set key = 'public_transport' %}\n {% set value = 'platform' %}\n{% else %}\n {% set key = 'public_transport' %}\n {% set value = 'stop_position' %}\n{% endif %}", + "pre": [ + "{% if tags.amenity in [ 'ferry_terminal', 'bus_station' ] %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% elseif tags.railway == 'platform' or tags.highway == 'platform' or tags.public_transport == 'platform' %}", + " {% set key = 'public_transport' %}", + " {% set value = 'platform' %}", + "{% else %}", + " {% set key = 'public_transport' %}", + " {% set value = 'stop_position' %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}" } } diff --git a/railway-electrification.json b/railway-electrification.json index 77efc25..7bce5c7 100644 --- a/railway-electrification.json +++ b/railway-electrification.json @@ -9,7 +9,31 @@ "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed)$'];" }, "feature": { - "pre": "{% if tags.electrified and tags.electrified != 'no' %}\n {% if tags.voltage < 5000 %}\n {% set color = colorInterpolate([ 'green', 'red' ], tags.voltage / 1000) %}\n {% else %}\n {% set color = colorInterpolate([ 'red', 'blue' ], (tags.voltage - 1000) / 24000) %}\n {% endif %}\n{% else %}\n {% set color='black' %}\n{%endif %}\n\n{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}\n {% set weight=2 %}\n {% else %}\n {% if tags.railway == 'rail' %}\n {% if tags.usage == 'main' or tags.usage == 'branch' %}\n {% set weight=3 %}\n {% else %}\n {% set weight=2.5 %}\n {% endif %}\n {% else %}\n {% set weight=2 %}\n {% endif %}\n{% endif %}", + "pre": [ + "{% if tags.electrified and tags.electrified != 'no' %}", + " {% if tags.voltage < 5000 %}", + " {% set color = colorInterpolate([ 'green', 'red' ], tags.voltage / 1000) %}", + " {% else %}", + " {% set color = colorInterpolate([ 'red', 'blue' ], (tags.voltage - 1000) / 24000) %}", + " {% endif %}", + "{% else %}", + " {% set color='black' %}", + "{%endif %}", + "", + "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", + " {% set weight=2 %}", + " {% else %}", + " {% if tags.railway == 'rail' %}", + " {% if tags.usage == 'main' or tags.usage == 'branch' %}", + " {% set weight=3 %}", + " {% else %}", + " {% set weight=2.5 %}", + " {% endif %}", + " {% else %}", + " {% set weight=2 %}", + " {% endif %}", + "{% endif %}" + ], "style:casing": { "weight": "{{ weight + 2 }}", "color": "{{ color }}", @@ -25,7 +49,13 @@ "style:highlight": { "color": "{{ color }}", "weight": "{{ weight }}", - "dashArray": "{% if not tags.electrified or tags.electrified == 'no' %}\n{% elseif tags.frequency == 0 %}\n{% else %}\n5,2\n{% endif %}", + "dashArray": [ + "{% if not tags.electrified or tags.electrified == 'no' %}", + "{% elseif tags.frequency == 0 %}", + "{% else %}", + "5,2", + "{% endif %}" + ], "fillColor": "{% if tags.railway == 'platform' %}#3f3f3f{% endif %}", "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}", "opacity": "1", @@ -33,8 +63,23 @@ }, "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing,highlight{% else %}default,highlight{% endif %}", "markerSign": null, - "body": "{{ tagTrans('railway', tags.railway) }}
\n{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", - "description": "{{ tagTrans('railway', tags.railway) }} -\n\n{% if tags.electrified == 'no' %}\n {{ trans('not electrified') }}\n{% elseif tags.electrified %}\n {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz\n{% endif %}", + "body": [ + "{{ tagTrans('railway', tags.railway) }}
", + "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", + "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}", + "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}", + "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
", + "{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}" + ], + "description": [ + "{{ tagTrans('railway', tags.railway) }} -", + "", + "{% if tags.electrified == 'no' %}", + " {{ trans('not electrified') }}", + "{% elseif tags.electrified %}", + " {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz", + "{% endif %}" + ], "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}", "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}" } diff --git a/railway-infrastructure.json b/railway-infrastructure.json index 3abec53..8cf266b 100644 --- a/railway-infrastructure.json +++ b/railway-infrastructure.json @@ -20,14 +20,39 @@ "color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#ff8100{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", "weight": "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}1{% else %}{% if tags.railway == 'rail' %}{% if tags.usage == 'main' or tags.usage == 'branch' %}3{% else %}2{% endif %}{% elseif tags.railway == 'platform' %}1{% else %}2{% endif %}{% endif %}", "dashArray": "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}", - "fillColor": "{% if tags.railway == 'platform' %}\n#3f3f3f\n{% elseif type == 'node' %}\n#ffffff\n{% endif %}", - "fill": "{% if tags.railway == 'platform' %}\n1\n{% elseif type == 'node' %}\n1\n{% else %}\n{% endif %}", + "fillColor": [ + "{% if tags.railway == 'platform' %}", + "#3f3f3f", + "{% elseif type == 'node' %}", + "#ffffff", + "{% endif %}" + ], + "fill": [ + "{% if tags.railway == 'platform' %}", + "1", + "{% elseif type == 'node' %}", + "1", + "{% else %}", + "{% endif %}" + ], "opacity": "1", - "fillOpacity": "{% if tags.railway == 'platform' %}\n0.2\n{% elseif type == 'node' %}\n0\n{% endif %}" + "fillOpacity": [ + "{% if tags.railway == 'platform' %}", + "0.2", + "{% elseif type == 'node' %}", + "0", + "{% endif %}" + ] }, "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}", "markerSign": null, - "body": "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", + "body": [ + "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", + "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}", + "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}", + "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
", + "{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}" + ], "description": "{{ tagTrans('railway', tags.railway) }}", "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}", "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}" diff --git a/religion.json b/religion.json index a91b536..c002e8c 100644 --- a/religion.json +++ b/religion.json @@ -17,13 +17,45 @@ "uk": "Релігія" }, "query": { - "13": "(\nnode[amenity~\"^(place_of_worship|grave_yard|crematorium)$\"];\nway[amenity~\"^(place_of_worship|grave_yard|crematorium)$\"];\nrelation[amenity~\"^(place_of_worship|grave_yard|crematorium)$\"];\nway[landuse~\"^(cemetery)$\"];\nrelation[landuse~\"^(cemetery)$\"];\n)" + "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)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.landuse == 'cemetery' %}\n{% set key = 'landuse' %}\n{% set value = tags.landuse %}\n{% else %}\n{% set key = 'amenity' %}\n{% set value = tags.amenity %}\n{% endif %}", + "pre": [ + "{% if tags.landuse == 'cemetery' %}", + "{% set key = 'landuse' %}", + "{% set value = tags.landuse %}", + "{% else %}", + "{% set key = 'amenity' %}", + "{% set value = tags.amenity %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}{% if tags.religion %}: {{ tagTransList('religion', tags.religion) }}{% endif %}", - "body": "{% if tags.religion %}\n {{ keyTrans('religion') }}: {{ tagTransList('religion', tags.religion) }}\n{% endif %}\n{% if tags.denomination %}\n
\n {{ keyTrans('denomination') }}: {{ tagTransList('denomination', tags.denomination) }}\n{% endif %}", - "markerSign": "{% if tags.religion == 'christian' %}✝\n{% elseif tags.religion == 'muslim' %}☪\n{% elseif tags.religion == 'buddhist' %}☸\n{% elseif tags.religion == 'hindu' %}ॐ\n{% elseif tags.religion == 'jewish' %}✡\n{% elseif tags.religion == 'pagan' %}☆\n{% endif %}", + "body": [ + "{% if tags.religion %}", + " {{ keyTrans('religion') }}: {{ tagTransList('religion', tags.religion) }}", + "{% endif %}", + "{% if tags.denomination %}", + "
", + " {{ keyTrans('denomination') }}: {{ tagTransList('denomination', tags.denomination) }}", + "{% endif %}" + ], + "markerSign": [ + "{% if tags.religion == 'christian' %}✝", + "{% elseif tags.religion == 'muslim' %}☪", + "{% elseif tags.religion == 'buddhist' %}☸", + "{% elseif tags.religion == 'hindu' %}ॐ", + "{% elseif tags.religion == 'jewish' %}✡", + "{% elseif tags.religion == 'pagan' %}☆", + "{% endif %}" + ], "popupDescription": "{{ tagTrans(key, value) }}" } } diff --git a/residential.json b/residential.json index d322a62..b243618 100644 --- a/residential.json +++ b/residential.json @@ -17,8 +17,20 @@ "uk": "Житлова зона" }, "query": { - "13": "(\nnode[landuse~\"^(residential)$\"];\nway[landuse~\"^(residential)$\"];\nrelation[landuse~\"^(residential)$\"];\n)", - "15": "(\nnode[landuse~\"^(residential|allotments)$\"];\nway[landuse~\"^(residential|allotments)$\"];\nrelation[landuse~\"^(residential|allotments)$\"];\n)" + "13": [ + "(", + "node[landuse~\"^(residential)$\"];", + "way[landuse~\"^(residential)$\"];", + "relation[landuse~\"^(residential)$\"];", + ")" + ], + "15": [ + "(", + "node[landuse~\"^(residential|allotments)$\"];", + "way[landuse~\"^(residential|allotments)$\"];", + "relation[landuse~\"^(residential|allotments)$\"];", + ")" + ] }, "feature": { "description": "{{ tagTrans('landuse', tags.landuse) }}" diff --git a/resources.json b/resources.json index 215f07a..2c2a243 100644 --- a/resources.json +++ b/resources.json @@ -11,10 +11,27 @@ "ru": "Добыча ресурсов" }, "query": { - "11": "(\nnode[landuse~\"^(quarry|salt_pond)$\"];\nnode[man_made~\"^(mineshaft)$\"];\nway[landuse~\"^(quarry|salt_pond)$\"];\nway[man_made~\"^(mineshaft)$\"];\nrelation[landuse~\"^(quarry|salt_pond)$\"];\nrelation[man_made~\"^(mineshaft)$\"];\n)" + "11": [ + "(", + "node[landuse~\"^(quarry|salt_pond)$\"];", + "node[man_made~\"^(mineshaft)$\"];", + "way[landuse~\"^(quarry|salt_pond)$\"];", + "way[man_made~\"^(mineshaft)$\"];", + "relation[landuse~\"^(quarry|salt_pond)$\"];", + "relation[man_made~\"^(mineshaft)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.landuse in [ 'quarry', 'salt_pond' ] %}\n {% set key = 'landuse' %}\n {% set value = tags.landuse %}\n{% else %}\n {% set key = 'man_made' %}\n {% set value = tags.man_made %}\n{% endif %}", + "pre": [ + "{% if tags.landuse in [ 'quarry', 'salt_pond' ] %}", + " {% set key = 'landuse' %}", + " {% set value = tags.landuse %}", + "{% else %}", + " {% set key = 'man_made' %}", + " {% set value = tags.man_made %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}" } } diff --git a/sport.json b/sport.json index 0dd15ce..db1dc05 100644 --- a/sport.json +++ b/sport.json @@ -19,7 +19,10 @@ }, "feature": { "description": "{{ tagTransList('sport', tags.sport) }}", - "markerSign": "{% set firstSport = tags.sport|split(';')[0] %}\n{{ const[firstSport] }}", + "markerSign": [ + "{% set firstSport = tags.sport|split(';')[0] %}", + "{{ const[firstSport] }}" + ], "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTransList('sport', tags.sport)) }}" }, "const": { diff --git a/tourism_attractions.json b/tourism_attractions.json index 0afd970..fb1b2bc 100644 --- a/tourism_attractions.json +++ b/tourism_attractions.json @@ -18,7 +18,13 @@ "uk": "Туризм" }, "query": { - "13": "(\nnode[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];\nway[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];\nrelation[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"]\n)" + "13": [ + "(", + "node[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];", + "way[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];", + "relation[tourism][tourism!~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"]", + ")" + ] }, "feature": { "description": "{{ tagTrans('tourism', tags.tourism) }}", diff --git a/tourism_services.json b/tourism_services.json index d018ac8..189ca70 100644 --- a/tourism_services.json +++ b/tourism_services.json @@ -18,7 +18,13 @@ "uk": "Туризм" }, "query": { - "13": "(\nnode[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];\nway[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];\nrelation[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"]\n)" + "13": [ + "(", + "node[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];", + "way[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"];", + "relation[tourism~\"^(alpine_hut|apartment|camp_site|caravan_site|chalet|guest_house|hostel|hotel|information|motel|wilderness_hut)$\"]", + ")" + ] }, "feature": { "description": "{{ tagTrans('tourism', tags.tourism) }}", diff --git a/walk_amenities.json b/walk_amenities.json index 194f169..a099acd 100644 --- a/walk_amenities.json +++ b/walk_amenities.json @@ -5,11 +5,50 @@ "de": "Einrichtungen" }, "query": { - "13": "(\nnode[highway~\"^(elevator)$\"];\nnode[information];\nnode[tourism~\"^(viewpoint)$\"];\nnode[man_made~\"^(cairn)$\"];\nnode[amenity~\"^(shelter)$\"];\nway[amenity~\"^(shelter)$\"];\nrelation[amenity~\"^(shelter)$\"];\n)", - "17": "(\nnode[highway~\"^(crossing|elevator)$\"];\nnode[information];\nnode[tourism~\"^(viewpoint)$\"];\nnode[man_made~\"^(cairn)$\"];\nnode[amenity~\"^(shelter)$\"];\nway[amenity~\"^(shelter)$\"];\nrelation[amenity~\"^(shelter)$\"];\n)" + "13": [ + "(", + "node[highway~\"^(elevator)$\"];", + "node[information];", + "node[tourism~\"^(viewpoint)$\"];", + "node[man_made~\"^(cairn)$\"];", + "node[amenity~\"^(shelter)$\"];", + "way[amenity~\"^(shelter)$\"];", + "relation[amenity~\"^(shelter)$\"];", + ")" + ], + "17": [ + "(", + "node[highway~\"^(crossing|elevator)$\"];", + "node[information];", + "node[tourism~\"^(viewpoint)$\"];", + "node[man_made~\"^(cairn)$\"];", + "node[amenity~\"^(shelter)$\"];", + "way[amenity~\"^(shelter)$\"];", + "relation[amenity~\"^(shelter)$\"];", + ")" + ] }, "feature": { - "pre": "{% if tags.information %}\n {% set key = 'information' %}\n {% set value = tags.information %}\n{% elseif tags.amenity in [ 'bench', 'shelter' ] %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% elseif tags.man_made in [ 'cairn' ] %}\n {% set key = 'man_made' %}\n {% set value = tags.man_made %}\n{% elseif tags.tourism in [ 'viewpoint'] %}\n {% set key = 'tourism' %}\n {% set value = tags.tourism %}\n{% else %}\n {% set key = 'highway' %}\n {% set value = tags.highway %}\n{% endif %}\n\n{% set type_data = const[value] %}", + "pre": [ + "{% if tags.information %}", + " {% set key = 'information' %}", + " {% set value = tags.information %}", + "{% elseif tags.amenity in [ 'bench', 'shelter' ] %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% elseif tags.man_made in [ 'cairn' ] %}", + " {% set key = 'man_made' %}", + " {% set value = tags.man_made %}", + "{% elseif tags.tourism in [ 'viewpoint'] %}", + " {% set key = 'tourism' %}", + " {% set value = tags.tourism %}", + "{% else %}", + " {% set key = 'highway' %}", + " {% set value = tags.highway %}", + "{% endif %}", + "", + "{% set type_data = const[value] %}" + ], "description": "{{ tagTrans(key, value) }}", "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(tagTrans(key, value)) }}", "markerSign": "{{ type_data.sign|raw }}", diff --git a/waste.json b/waste.json index a608aec..adfb9e4 100644 --- a/waste.json +++ b/waste.json @@ -12,12 +12,51 @@ "ru": "Переработка отходов" }, "query": { - "13": "(\nnode[landuse=landfill];\nnode[man_made=wastewater_plant];\nnode[amenity=recycling][recycling_type=centre];\nway[landuse=landfill];\nway[man_made=wastewater_plant];\nway[amenity=recycling][recycling_type=centre];\nrelation[landuse=landfill];\nrelation[man_made=wastewater_plant];\nrelation[amenity=recycling][recycling_type=centre];\n)", - "15": "(\nnode[landuse=landfill];\nnode[man_made=wastewater_plant];\nnode[amenity=recycling];\nway[landuse=landfill];\nway[man_made=wastewater_plant];\nway[amenity=recycling];\nrelation[landuse=landfill];\nrelation[man_made=wastewater_plant];\nrelation[amenity=recycling];\n)" + "13": [ + "(", + "node[landuse=landfill];", + "node[man_made=wastewater_plant];", + "node[amenity=recycling][recycling_type=centre];", + "way[landuse=landfill];", + "way[man_made=wastewater_plant];", + "way[amenity=recycling][recycling_type=centre];", + "relation[landuse=landfill];", + "relation[man_made=wastewater_plant];", + "relation[amenity=recycling][recycling_type=centre];", + ")" + ], + "15": [ + "(", + "node[landuse=landfill];", + "node[man_made=wastewater_plant];", + "node[amenity=recycling];", + "way[landuse=landfill];", + "way[man_made=wastewater_plant];", + "way[amenity=recycling];", + "relation[landuse=landfill];", + "relation[man_made=wastewater_plant];", + "relation[amenity=recycling];", + ")" + ] }, "feature": { - "pre": "{% if tags.landuse == 'landfill' %}\n {% set key = 'landuse' %}\n {% set value = tags.landuse %}\n{% elseif tags.man_made == 'wastewater_plant' %}\n {% set key = 'man_made' %}\n {% set value = tags.man_made %}\n{% elseif tags.amenity == 'recycling' %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}", + "pre": [ + "{% if tags.landuse == 'landfill' %}", + " {% set key = 'landuse' %}", + " {% set value = tags.landuse %}", + "{% elseif tags.man_made == 'wastewater_plant' %}", + " {% set key = 'man_made' %}", + " {% set value = tags.man_made %}", + "{% elseif tags.amenity == 'recycling' %}", + " {% set key = 'amenity' %}", + " {% set value = tags.amenity %}", + "{% endif %}" + ], "description": "{{ tagTrans(key, value) }}", - "body": "{% if tags.recycling_type %}\n{{ keyTrans('recycling_type') }}: {{ tagTrans('recycling_type', tags.recycling_type) }}\n{% endif %}" + "body": [ + "{% if tags.recycling_type %}", + "{{ keyTrans('recycling_type') }}: {{ tagTrans('recycling_type', tags.recycling_type) }}", + "{% endif %}" + ] } } diff --git a/wikipedia.json b/wikipedia.json index 897d6cf..9dd0cd2 100644 --- a/wikipedia.json +++ b/wikipedia.json @@ -4,11 +4,52 @@ "en": "Wikipedia" }, "query": { - "14": "(\nnode[~\"wikipedia\"~\".\"];\nway[~\"wikipedia\"~\".\"];\nrelation[~\"wikipedia\"~\".\"];\n\nnode[~\"wikidata$\"~\".\"];\nway[~\"wikidata$\"~\".\"];\nrelation[~\"wikidata$\"~\".\"];\n\nnode[wikimedia_commons];\nway[wikimedia_commons];\nrelation[wikimedia_commons];\n)" + "14": [ + "(", + "node[~\"wikipedia\"~\".\"];", + "way[~\"wikipedia\"~\".\"];", + "relation[~\"wikipedia\"~\".\"];", + "", + "node[~\"wikidata$\"~\".\"];", + "way[~\"wikidata$\"~\".\"];", + "relation[~\"wikidata$\"~\".\"];", + "", + "node[wikimedia_commons];", + "way[wikimedia_commons];", + "relation[wikimedia_commons];", + ")" + ] }, "feature": { - "pre": "{% set errors = [] %}\n{% for k, v in tags %}\n\n{% if k|matches(\"^wikipedia:\") %}\n {% set errors = errors|merge([\"Uses wikipedia and old-style \" ~ k ~ \" tag\"]) %}\n{% elseif k|matches(\"^wikipedia:\") %}\n {% set errors = errors|merge([\"Uses old-style \" ~ k ~ \" tag\"]) %}\n{% endif %}\n\n{% if k|matches(\":?wikipedia$\") and not v|matches(\"^[a-z-]+:\") %}\n {% set errors = errors|merge([\"Tag \" ~ k ~ \" does not contain language information: \" ~ v ]) %}\n{% endif %}\n\n{% endfor %}", - "description": "{% if errors|length %}\n{{ errors|length }} {{ trans('error', errors|length) }}\n{% endif %}", - "body": "{% if errors|length %}\n{{ trans('error', errors|length) }}:
    \n{% for e in errors %}\n
  • {{ e|raw }}
  • \n{% endfor %}\n
\n{% endif %}" + "pre": [ + "{% set errors = [] %}", + "{% for k, v in tags %}", + "", + "{% if k|matches(\"^wikipedia:\") %}", + " {% set errors = errors|merge([\"Uses wikipedia and old-style \" ~ k ~ \" tag\"]) %}", + "{% elseif k|matches(\"^wikipedia:\") %}", + " {% set errors = errors|merge([\"Uses old-style \" ~ k ~ \" tag\"]) %}", + "{% endif %}", + "", + "{% if k|matches(\":?wikipedia$\") and not v|matches(\"^[a-z-]+:\") %}", + " {% set errors = errors|merge([\"Tag \" ~ k ~ \" does not contain language information: \" ~ v ]) %}", + "{% endif %}", + "", + "{% endfor %}" + ], + "description": [ + "{% if errors|length %}", + "{{ errors|length }} {{ trans('error', errors|length) }}", + "{% endif %}" + ], + "body": [ + "{% if errors|length %}", + "{{ trans('error', errors|length) }}:
    ", + "{% for e in errors %}", + "
  • {{ e|raw }}
  • ", + "{% endfor %}", + "
", + "{% endif %}" + ] } }