{
"type": "overpass",
"name": {
"de": "Eisenbahn Elektrifizierung",
"en": "Railway electrification"
},
"query": {
"11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed)$'][usage~'^(main|branch)$'];",
"14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed)$'];"
},
"feature": {
"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 }}",
"dashArray": "2,4",
"lineCap": "butt"
},
"style": {
"color": "white",
"weight": "{{ weight }}",
"fill": null,
"opacity": "1"
},
"style:highlight": {
"color": "{{ color }}",
"weight": "{{ weight }}",
"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",
"lineCap": "butt"
},
"styles": "{% if tags.railway == 'narrow_gauge' %}default,casing,highlight{% else %}default,highlight{% endif %}",
"markerSign": null,
"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')) }}"
}
}