Main categories of OpenStreetBrowser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

132 lines
5.9 KiB

{
"type": "overpass",
"name": {
"de": "Eisenbahn Elektrifizierung",
"en": "Railway electrification",
"fr": "Puissance électrique ferroviaire",
"hu": "Vasút villamosítottsága",
"pt": "Eletrificação ferroviária",
"pt-br": "Eletrificação ferroviária"
},
"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.electrified and tags.electrified != 'no' %}",
" {% if not tags.voltage is defined %}",
" {% set color = '#7f7f7f' %}",
" {% elseif not tags.voltage|matches('^[0-9]+$') %}",
" {% set color = '#ff0000' %}",
" {% elseif tags.voltage < 1000 %}",
" {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}",
" {% else %}",
" {% set color = colorInterpolate([ 'blue', '#af0000' ], (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 width=2 %}",
" {% else %}",
" {% if tags.railway == 'rail' %}",
" {% if tags.usage == 'main' or tags.usage == 'branch' %}",
" {% set width=3 %}",
" {% else %}",
" {% set width=2.5 %}",
" {% endif %}",
" {% else %}",
" {% set width=2 %}",
" {% endif %}",
"{% endif %}"
],
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
"description": [
"{{ tagTrans('railway', tags.railway) }}",
"",
"{% if tags.electrified == 'no' %}",
" - {{ tagTrans('electrified', 'no') }}",
"{% elseif tags.electrified %}",
" - {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
"{% endif %}"
],
"body": [
"{{ tagTrans('railway', tags.railway) }}<br/>",
"{% 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 %}"
],
"markerSymbol": null,
"listMarkerSymbol": "line",
"styles": "casing,default",
"priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
"style": {
"width": "{{ width }}",
"lineCap": "butt",
"color": "{{ color }}",
"opacity": "1",
"fill": null,
"dashArray": [
"{% if not tags.electrified is defined %}",
"{% elseif tags.frequency == 0 %}",
"{% else %}",
"5,2",
"{% endif %}"
]
},
"style:casing": {
"width": "{{ width }}",
"color": "white",
"opacity": "1",
"fill": null
}
},
"info": [
"<table>",
" {% set color = '#000000' %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ trans('not electrified') }}</td>",
" </tr>",
"{% for i in range(0, 1000, 200) %}",
" {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ i }}V</td>",
" </tr>",
"{% endfor %}",
"",
"{% for i in range(3000, 25000, 2000) %}",
" {% set color = colorInterpolate([ 'blue', '#af0000' ], (i - 1000) / 24000) %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ i }}V</td>",
" </tr>",
"{% endfor %}",
"",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ trans('tag:frequency=0') }}</td>",
" </tr>",
"",
" <tr>",
" <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'width': 3, 'color': 'white' }, 'style': { 'width': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>",
" <td>{{ trans('tag:frequency>0') }}</td>",
" </tr>",
"",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': '#7f7f7f' })|raw }}</td>",
" <td>{{ trans('unknown') }}</td>",
" </tr>",
"",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': '#ff0000' })|raw }}</td>",
" <td>{{ trans('illegal value') }}</td>",
" </tr>",
"</table>"
]
}