From 0d37e906c8fae4bd9e857ec6cac99f0d50c65928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Oct 2018 20:36:51 +0200 Subject: [PATCH 1/6] Split memorial from historic --- culture_religion.json | 3 ++ historic.json | 34 ++++++---------------- memorial.json | 65 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 26 deletions(-) create mode 100644 memorial.json diff --git a/culture_religion.json b/culture_religion.json index 2d68d92..52cc1a5 100644 --- a/culture_religion.json +++ b/culture_religion.json @@ -28,6 +28,9 @@ { "id": "historic" }, + { + "id": "memorial" + }, { "id": "religion" }, diff --git a/historic.json b/historic.json index 8ab235d..dab36a1 100644 --- a/historic.json +++ b/historic.json @@ -22,28 +22,22 @@ "query": { "11": [ "(", - "node[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", - "way[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", - "relation[historic~\"^(castle|archaeological_site|battlefield|monument)$\"];", + "node[historic~\"^(castle|archaeological_site|battlefield)$\"];", + "way[historic~\"^(castle|archaeological_site|battlefield)$\"];", + "relation[historic~\"^(castle|archaeological_site|battlefield)$\"];", ")" ], "14": [ "(", - "node[historic];", - "way[historic];", - "relation[historic];", + "node[historic][historic!~\"^(memorial|monument)$\"];", + "way[historic][historic!~\"^(memorial|monument)$\"];", + "relation[historic][historic!~\"^(memorial|monument)$\"];", ")" ] }, "feature": { - "pre": [ - "{% set value = tags.historic %}", - "{% if const[tags.historic ~ ' memorial=' ~ tags.memorial] %}", - " {% set value = tags.historic ~ ' memorial=' ~ tags.memorial %}", - "{% endif %}" - ], - "description": "{{ tagTransList('historic', value) }}", - "markerSign": "{{ const[value].sign|raw }}" + "description": "{{ tagTransList('historic', tags.historic) }}", + "markerSign": "{{ const[tags.historic].sign|raw }}" }, "info": [ "", @@ -79,18 +73,6 @@ "aircraft": { "sign": "", "zoom": 14 - }, - "memorial": { - "sign": "", - "zoom": 14 - }, - "memorial memorial=plaque": { - "sign": "", - "zoom": 14 - }, - "monument": { - "sign": "", - "zoom": 11 } } } diff --git a/memorial.json b/memorial.json new file mode 100644 index 0000000..666c93a --- /dev/null +++ b/memorial.json @@ -0,0 +1,65 @@ +{ + "type": "overpass", + "name": { + "de": "Denkmäler", + "en": "Memorials" + }, + "query": { + "11": [ + "(", + "node[historic~\"^(monument)$\"];", + "way[historic~\"^(monument)$\"];", + "relation[historic~\"^(monument)$\"];", + ")" + ], + "14": [ + "(", + "node[historic~\"^(memorial|monument)$\"];", + "way[historic~\"^(memorial|monument)$\"];", + "relation[historic~\"^(memorial|monument)$\"];", + ")" + ] + }, + "feature": { + "pre": [ + "{% set value = tags.historic %}", + "{% if const[tags.historic ~ ' memorial=' ~ tags.memorial] %}", + " {% set value = tags.historic ~ ' memorial=' ~ tags.memorial %}", + "{% endif %}" + ], + "description": "{{ tagTransList('historic', value) }}", + "markerSign": "{{ const[value].sign|raw }}" + }, + "info": [ + "
", + "{% for value, data in const %}", + "{% if data.zoom <= map.zoom %}", + " ", + " ", + " ", + " ", + "{% endif %}", + "{% endfor %}", + "{% if 14 <= map.zoom %}", + " ", + " ", + " ", + " ", + "{% endif %}", + "
{{ markerCircle({})|raw }}
{{ data.sign|raw }}
{{ tagTrans('historic', value) }}
{{ markerCircle({})|raw }}
{{ trans('other') }}
" + ], + "const": { + "memorial": { + "sign": "", + "zoom": 14 + }, + "memorial memorial=plaque": { + "sign": "", + "zoom": 14 + }, + "monument": { + "sign": "", + "zoom": 11 + } + } +} From 979714e92cc73760d992a9462e35c38e1afc7356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Oct 2018 21:29:12 +0200 Subject: [PATCH 2/6] Memorial: use "historic=memorial memorial=*" (or alias memorial:type=*) as description --- memorial.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memorial.json b/memorial.json index 666c93a..117785c 100644 --- a/memorial.json +++ b/memorial.json @@ -23,8 +23,10 @@ "feature": { "pre": [ "{% set value = tags.historic %}", - "{% if const[tags.historic ~ ' memorial=' ~ tags.memorial] %}", + "{% if tags.historic == 'memorial' and tags.memorial %}", " {% set value = tags.historic ~ ' memorial=' ~ tags.memorial %}", + "{% elseif tags.historic == 'memorial' and attribute(tags, 'memorial:type') %}", + " {% set value = tags.historic ~ ' memorial=' ~ attribute(tags, 'memorial:type') %}", "{% endif %}" ], "description": "{{ tagTransList('historic', value) }}", From 2564cbd9efca9436dcb546ad152be5a81811efa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Oct 2018 22:21:51 +0200 Subject: [PATCH 3/6] historic/religion: move wayside_cross/wayside_shrine to religion --- historic.json | 6 +++--- religion.json | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/historic.json b/historic.json index dab36a1..e69ce8b 100644 --- a/historic.json +++ b/historic.json @@ -29,9 +29,9 @@ ], "14": [ "(", - "node[historic][historic!~\"^(memorial|monument)$\"];", - "way[historic][historic!~\"^(memorial|monument)$\"];", - "relation[historic][historic!~\"^(memorial|monument)$\"];", + "node[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine)$\"];", + "way[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine)$\"];", + "relation[historic][historic!~\"^(memorial|monument|wayside_cross|wayside_shrine)$\"];", ")" ] }, diff --git a/religion.json b/religion.json index 967b59e..c5b12fc 100644 --- a/religion.json +++ b/religion.json @@ -27,6 +27,18 @@ "way[landuse~\"^(cemetery)$\"];", "relation[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)$\"];", + "way[historic~\"^wayside_(cross|shrine)$\"];", + "relation[historic~\"^wayside_(cross|shrine)$\"];", + ")" ] }, "feature": { @@ -34,6 +46,9 @@ "{% if tags.landuse == 'cemetery' %}", "{% set key = 'landuse' %}", "{% set value = tags.landuse %}", + "{% elseif tags.historic == 'wayside_cross' or tags.historic == 'wayside_shrine' %}", + "{% set key = 'historic' %}", + "{% set value = tags.historic %}", "{% else %}", "{% set key = 'amenity' %}", "{% set value = tags.amenity %}", From a1c25cfe7691b973a66e25aca79e3e4933feac1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 26 Oct 2018 19:27:57 +0200 Subject: [PATCH 4/6] railway-maxspeed: new category --- index.json | 3 ++ railway-maxspeed.json | 114 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 railway-maxspeed.json diff --git a/index.json b/index.json index c3eb88e..3438f79 100644 --- a/index.json +++ b/index.json @@ -277,6 +277,9 @@ { "id": "railway-electrification" }, + { + "id": "railway-maxspeed" + }, { "id": "railway-routes" } diff --git a/railway-maxspeed.json b/railway-maxspeed.json new file mode 100644 index 0000000..261bdcf --- /dev/null +++ b/railway-maxspeed.json @@ -0,0 +1,114 @@ +{ + "type": "overpass", + "name": { + "de": "Höchstgeschwindigkeiten", + "en": "Maxspeed", + "fr": "Limites de vitesse", + "hu": "Sebességkorlátozás", + "pt": "Velocidade máxima", + "pt-br": "Velocidade máxima" + }, + "query": { + "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];", + "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'];" + }, + "feature": { + "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(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}", + "{% endif %}" + ], + "description": [ + "{% if maxspeed %}", + "{{ maxspeed }} {{ unit }}", + "{% elseif tags.maxspeed %}", + "{{ tags.maxspeed }}", + "{% else %}", + "{{ trans('unknown') }}", + "{% endif %}" + ], + "markerSymbol": null, + "listMarkerSymbol": "line", + "style": { + "width": "3", + "color": "{{ color }}" + } + }, + "const": { + "colorMap": [ + "#00af00", + "#ff7f00", + "#ff0000", + "#af00af" + ], + "highestColorSpeed": 300, + "offsetColorSpeed": 20 + }, + "info": [ + "
", + "", + " ", + " ", + " ", + " ", + "{% for i in range(25, 280, 25) %}", + " ", + " ", + " ", + " ", + "{% endfor %}", + " ", + " ", + " ", + " ", + "
{{ markerLine(evaluate({}))|raw }}{{ trans('unknown') }}
{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}{{ i }}km/h
{{ markerLine(evaluate({ \"maxspeed\": 300 }))|raw }}≥300km/h
", + "
", + "", + "
", + "", + " ", + " ", + " ", + " ", + "{% for i in range(15, 150, 15) %}", + " ", + " ", + " ", + " ", + "{% endfor %}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "
{{ markerLine(evaluate({}))|raw }}{{ trans('unknown') }}
{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}{{ i }}mph
{{ markerLine(evaluate({ \"maxspeed\": (175 * 1.60934)|round }))|raw }}175mph
{{ markerLine(evaluate({ \"maxspeed\": (200 * 1.60934)|round }))|raw }}≥200mph
", + "
" + ] +} From e6838b8e2de4d2a3a5d9d9eb6702c1b43be92e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 26 Oct 2018 19:36:59 +0200 Subject: [PATCH 5/6] car_maxspeed/railway-maxspeed: show speed (w/o unit) as label --- car_maxspeed.json | 5 ++++- railway-maxspeed.json | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/car_maxspeed.json b/car_maxspeed.json index 0b50d60..b2249f3 100644 --- a/car_maxspeed.json +++ b/car_maxspeed.json @@ -57,7 +57,10 @@ "listMarkerSymbol": "line", "style": { "width": "3", - "color": "{{ color }}" + "color": "{{ color }}", + "text": "{{ maxspeed }} ", + "textRepeat": "1", + "textFontWeight": "bold" } }, "const": { diff --git a/railway-maxspeed.json b/railway-maxspeed.json index 261bdcf..9ce73db 100644 --- a/railway-maxspeed.json +++ b/railway-maxspeed.json @@ -55,7 +55,10 @@ "listMarkerSymbol": "line", "style": { "width": "3", - "color": "{{ color }}" + "color": "{{ color }}", + "text": "{{ maxspeed }} ", + "textRepeat": "1", + "textFontWeight": "bold" } }, "const": { From 3122a83cbe7f66c0f04d1fbdec4e24b66e201ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 26 Oct 2018 20:32:16 +0200 Subject: [PATCH 6/6] railway-maxspeed: prefix name by railway (DE/EN) --- railway-maxspeed.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railway-maxspeed.json b/railway-maxspeed.json index 9ce73db..10fb8a4 100644 --- a/railway-maxspeed.json +++ b/railway-maxspeed.json @@ -1,8 +1,8 @@ { "type": "overpass", "name": { - "de": "Höchstgeschwindigkeiten", - "en": "Maxspeed", + "de": "Eisenbahn Höchstgeschwindigkeiten", + "en": "Railway Maxspeed", "fr": "Limites de vitesse", "hu": "Sebességkorlátozás", "pt": "Velocidade máxima",