{ "type": "overpass", "name": { "en": "Railway infrastructure", "de": "Eisenbahn Infrastruktur" }, "query": { "11": "(way[railway=rail][usage~'^(main|branch)$'];node[railway~'^(station)$'];)", "14": "(way[railway];node[railway~'^(station|halt|tram_stop)$'];)", "18": "(node[railway];way[railway];)" }, "feature": { "pre": [ "{% set railway_type = null %}", "", "{% if tags.railway == 'disused' %}", " {% set railway_type = attribute(tags, 'disused:railway')|default(tags.disused) %}", "{% elseif tags.railway == 'abandoned' %}", " {% set railway_type = attribute(tags, 'abandoned:railway')|default(tags.abandoned) %}", "{% elseif tags.railway == 'proposed' %}", " {% set railway_type = attribute(tags, 'proposed:railway')|default(tags.proposed) %}", "{% elseif tags.railway in [ 'rail', 'narrow_gauge', 'subway', 'light_rail', 'tram' ] %}", " {% set railway_type = tags.railway %}", "{% endif %}" ], "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", "description": "{{ tagTrans('railway', tags.railway) }}", "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 %}", "" ], "markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}H{% endif %}", "markerSymbol": [ "{% if tags.railway == 'signal' %}", "", " ", " ", " ", "", "{% elseif tags.railway == 'switch' %}", "", " ", " ", " ", "", "{% elseif tags.railway == 'railway_crossing' %}", "", " ", " ", " ", "", "{% endif %}" ], "listMarkerSymbol": [ "{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal', 'switch', 'railway_crossing' ] %}", "{% else %}", "line", "{% endif %}" ], "priority": [ "{% if tags.railway == 'station' %}0", "{% elseif tags.railway in [ 'halt' ] %}1", "{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2", "{% elseif tags.railway in [ 'subway_entrance' ] %}3", "{% else %}5", "{% endif %}" ], "styles": [ "{% if railway_type %}", "highlight,default", "{% else %}", "default", "{% endif %}" ], "style": { "width": [ "{% if tags.railway in [ 'platform' ] %}", "1", "{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", "0", "{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", "1", "{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", " 3", "{% else %}", " 2", "{% endif %}" ], "color": "{{ const[railway_type].color }}", "opacity": "1", "lineCap": [ "{% if tags.railway in [ 'disused', 'abandoned', 'proposed' ] %}", "butt", "{% else %}", "round", "{% endif %}" ], "dashArray": [ "{% if tags.railway == 'disused' %}1,5", "{% elseif tags.railway == 'abandoned' %}1,7", "{% elseif tags.railway == 'proposed' %}2,2", "{% elseif tags.tunnel %}5,5", "{% endif %}" ], "fill": [ "{% if tags.railway == 'platform' %}", "1", "{% elseif type == 'node' %}", "1", "{% else %}", "{% endif %}" ], "fillColor": [ "{% if tags.railway == 'platform' %}", "#3f3f3f", "{% elseif type == 'node' %}", "#ffffff", "{% endif %}" ], "fillOpacity": [ "{% if tags.railway == 'platform' %}", "0.2", "{% elseif type == 'node' %}", "0", "{% endif %}" ] }, "style:highlight": { "width": [ "{% if tags.railway in [ 'platform' ] %}", "1", "{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", "0", "{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", "1", "{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", " 3", "{% else %}", " 2", "{% endif %}" ], "color": "#ffffff" } }, "info": [ "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "{% if map.zoom >= 14 %}", " ", " ", " ", " ", "{% endif %}", "
{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"main\" }))|raw }}{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}
{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"branch\" }))|raw }}{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'branch') }}
{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}{{ tagTrans('railway', 'rail') }}
{{ markerLine(evaluate({ \"railway\": \"narrow_gauge\" }))|raw }}{{ tagTrans('railway', 'narrow_gauge') }}
{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}{{ tagTrans('railway', 'subway') }}
{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}{{ tagTrans('railway', 'light_rail') }}
{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}{{ tagTrans('railway', 'tram') }}
" ], "const": { "rail": { "color": "#000000" }, "narrow_gauge": { "color": "#7f003f" }, "subway": { "color": "#0000ff" }, "light_rail": { "color": "#7f00ff" }, "tram": { "color": "#ff00ff" } } }