|
|
{ "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') }}<br>{% endif %}", "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}", "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}", "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>", "{% 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')) }}<br/>{% endif %}", "" ], "markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}H{% endif %}", "markerSymbol": [ "{% if tags.railway == 'signal' %}", "<svg anchorX='5' anchorY='8' width='9' height='15'>", " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />", " <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>", " <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>", "</Xsvg>", "{% elseif tags.railway == 'switch' %}", "<svg anchorX='5' anchorY='8' width='9' height='15'>", " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />", " <line x1='2' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", " <line x1='2' x2='7' y1='10' y2='2' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", "</svg>", "{% elseif tags.railway == 'railway_crossing' %}", "<svg anchorX='5' anchorY='8' width='9' height='15'>", " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />", " <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", " <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", "</svg>", "{% 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": [ "<table>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"main\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>", " </tr>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"branch\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'branch') }}</td>", " </tr>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'rail') }}</td>", " </tr>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"narrow_gauge\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>", " </tr>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'subway') }}</td>", " </tr>", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'light_rail') }}</td>", " </tr>", "{% if map.zoom >= 14 %}", " <tr>", " <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>", " <td>{{ tagTrans('railway', 'tram') }}</td>", " </tr>", "{% endif %}", "</table>" ], "const": { "rail": { "color": "#000000" }, "narrow_gauge": { "color": "#7f003f" }, "subway": { "color": "#0000ff" }, "light_rail": { "color": "#7f00ff" }, "tram": { "color": "#ff00ff" } } }
|