From 393d6b9c8a373b6033ef0c901182c5c44d4261a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 24 Jul 2017 09:23:08 +0200 Subject: [PATCH 1/3] Category 'railway' --- index.json | 3 +++ railway.json | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 railway.json diff --git a/index.json b/index.json index 2cce7f475..aab4ede1e 100644 --- a/index.json +++ b/index.json @@ -74,6 +74,9 @@ { "id": "power" }, + { + "id": "railway" + }, { "id": "works" } diff --git a/railway.json b/railway.json new file mode 100644 index 000000000..517abd51d --- /dev/null +++ b/railway.json @@ -0,0 +1,25 @@ +{ + "type": "overpass", + "query": { + "11": "(way[railway=rail][usage~'^(main|branch)$'];node[railway~'^(station)$'];)", + "14": "(way[railway];node[railway~'^(station|halt|tram_stop)$'];)", + "17": "(node[railway];way[railway];)" + }, + "minZoom": 11, + "feature": { + "style": { + "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 == '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' %}#3f3f3f{% endif %}", + "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}", + "opacity": 1.0 + }, + "markerSign": "", + "body": "{{ tagTrans('railway', tags.railway) }}
\n{% if tags.operator %}{{ tagTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ tagTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ tagTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ tagTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ tagTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ tagTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", + "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')) }}" + } +} + From 07d9e0b6adcf5c5879df20a2704608f7f73b998d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 26 Jul 2017 09:17:54 +0200 Subject: [PATCH 2/3] keyTrans() to translate keys --- children.json | 4 ++-- communication.json | 2 +- education.json | 2 +- gastro.json | 2 +- places.json | 2 +- power.json | 2 +- public.json | 2 +- railway.json | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/children.json b/children.json index 5ba1b210b..246ec080f 100644 --- a/children.json +++ b/children.json @@ -4,7 +4,7 @@ "minZoom": 15, "feature": { "markerSign": "{% if tags.leisure=='playground' %}⛹{% elseif tags.leisure=='summer_camp'%}🏕{% elseif tags.leisure=='indoor_play' or tags.kids_area %}🏠{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{% elseif tags.amenity=='toilets' and tags.diaper %}🚽🚼{% endif %}", - "body": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}", - "description": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}" + "body": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ keyTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ keyTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}", + "description": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ keyTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ keyTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}" } } diff --git a/communication.json b/communication.json index 62ac5144e..419a9397b 100644 --- a/communication.json +++ b/communication.json @@ -8,7 +8,7 @@ "feature": { "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) |default(tagTrans('amenity', tags.amenity)) }}", "markerSign": "{% if tags.amenity=='post_office' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/education.json b/education.json index 1d92afabf..266958c12 100644 --- a/education.json +++ b/education.json @@ -8,7 +8,7 @@ "minZoom": 11, "feature": { "markerSign": "{% if tags.amenity == 'university' or tags.amenity == 'college' %}🎓{% elseif tags.amenity == 'library' %}🕮{% elseif tags.amenity == 'school' or tags.amenity == 'language_school' %}🏫{% elseif tags.amenity == 'kindergarten' %}⛹{% elseif tags.amenity == 'public_bookcase' %}📚{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ tags.operator }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ tags.operator }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}", "priority": "{% if tags.amenity == 'university' %}0{% elseif tags.amenity == 'college' %}1{% elseif tags.amenity == 'library' %}2{% elseif tags.amenity == 'school' or tags.amenity == 'language_school' %}3{% elseif tags.amenity == 'kindergarten' %}4{% elseif tags.amenity == 'public_bookcase' %}5{% endif %}" } diff --git a/gastro.json b/gastro.json index a9629db2a..b42cf9ef4 100644 --- a/gastro.json +++ b/gastro.json @@ -4,7 +4,7 @@ "minZoom": 16, "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": "{{ tagTrans('amenity', tags.amenity) }}
{{ tagTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default(trans('unknown')) }}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{{ keyTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default(trans('unknown')) }}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/places.json b/places.json index 8bd249225..77dcd99e4 100644 --- a/places.json +++ b/places.json @@ -13,7 +13,7 @@ "minZoom": 0, "feature": { "title": "{% set loc_name = localizedTag(tags, 'name') %}{{ loc_name }}{% if loc_name != tags.name %} ({{ tags.name }}){% endif %}", - "body": "{{ tagTrans('place', tags.place) }}\n{% if tags.population %}
{{ tagTrans('population') }}: {{ tags.population }}{% endif %} \n", + "body": "{{ tagTrans('place', tags.place) }}\n{% if tags.population %}
{{ keyTrans('population') }}: {{ tags.population }}{% endif %} \n", "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 bd045a735..09039c575 100644 --- a/power.json +++ b/power.json @@ -9,7 +9,7 @@ "minZoom": 11, "feature": { "markerSign": "", - "body": "{{ tagTrans('power', tags.power) }}\n{% set x='generator:source' %}{% if tags[x] %}
{{ tagTrans('generator:source') }}: {{ tagTransList('generator:source', tags[x]) }}{% endif %}\n{% set x='generator:method' %}{% if tags[x] %}
{{ tagTrans('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": "{{ tagTrans('power', tags.power) }}\n{% 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 %}", "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 %}" } diff --git a/public.json b/public.json index b9a3763e0..980ffc4b9 100644 --- a/public.json +++ b/public.json @@ -8,7 +8,7 @@ "feature": { "title": "{{ tags.name|default(tags.operator)|default(tagTrans('amenity', tags.amenity)) }}", "markerSign": "{% if tags.amenity=='post_office' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ tagTrans('operator') }}: {{ tags.operator }}
{% endif %}", + "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}{{ keyTrans('operator') }}: {{ tags.operator }}
{% endif %}", "description": "{{ tagTrans('amenity', tags.amenity) }}" } } diff --git a/railway.json b/railway.json index 517abd51d..2543a78d6 100644 --- a/railway.json +++ b/railway.json @@ -16,7 +16,7 @@ "opacity": 1.0 }, "markerSign": "", - "body": "{{ tagTrans('railway', tags.railway) }}
\n{% if tags.operator %}{{ tagTrans('operator') }}: {{ localizedTag(tags, 'operator') }}
{% endif %}\n{% if tags.usage %}{{ tagTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}
{% endif %}\n{% if tags.service %}{{ tagTrans('service') }}: {{ tagTrans('service', tags.service ) }}
{% endif %}\n{{ tagTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}
\n{% if tags.electrified == 'no' %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ tagTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ tagTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ tagTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
{% endif %}\n", + "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) }}", "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')) }}" From 657390498992318781172a5e519da9c90754c4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 26 Jul 2017 09:25:31 +0200 Subject: [PATCH 3/3] railway: add dashed casing for narrow_gauge railways --- railway.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/railway.json b/railway.json index 2543a78d6..03a6eafbd 100644 --- a/railway.json +++ b/railway.json @@ -7,6 +7,12 @@ }, "minZoom": 11, "feature": { + "style:casing": { + "weight": "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}5{% else %}{% if tags.railway == 'rail' %}{% if tags.usage == 'main' or tags.usage == 'branch' %}7{% else %}6{% endif %}{% elseif tags.railway == 'platform' %}5{% else %}6{% endif %}{% endif %}", + "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 == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", + "dashArray": "2,4", + "lineCap": "butt" + }, "style": { "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 == '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 %}", @@ -15,6 +21,7 @@ "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}", "opacity": 1.0 }, + "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}", "markerSign": "", "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) }}",