Browse Source

Merge branch 'railway-electrification'

climbing
parent
commit
a1d76524f6
  1. 45
      railway-electrification.json

45
railway-electrification.json

@ -16,18 +16,18 @@
"pre": [
"{% if tags.electrified and tags.electrified != 'no' %}",
" {% if not tags.voltage is defined %}",
" {% set color = '#7f7f7f' %}",
" {% set color = const.colorUnknown %}",
" {% elseif not tags.voltage|matches('^[0-9]+$') %}",
" {% set color = '#ff0000' %}",
" {% elseif tags.voltage < 1000 %}",
" {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}",
" {% set color = const.colorIllegal %}",
" {% elseif tags.voltage < const.range[1] %}",
" {% set color = colorInterpolate(const.scheme|slice(0, 2), tags.voltage / const.range[1]) %}",
" {% else %}",
" {% set color = colorInterpolate([ 'blue', '#af0000' ], (tags.voltage - 1000) / 24000) %}",
" {% set color = colorInterpolate(const.scheme|slice(1, 2), (tags.voltage - const.range[1]) / (const.range[2] - const.range[1])) %}",
" {% endif %}",
"{% elseif tags.electrified and tags.electrified == 'no' %}",
" {% set color = '#000000' %}",
" {% set color = const.colorNone %}",
"{% else %}",
" {% set color = '#7f7f7f' %}",
" {% set color = const.colorUnknown %}",
"{% endif %}",
"",
"{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
@ -35,9 +35,9 @@
" {% else %}",
" {% if tags.railway == 'rail' %}",
" {% if tags.usage == 'main' or tags.usage == 'branch' %}",
" {% set width=3 %}",
" {% set width=4 %}",
" {% else %}",
" {% set width=2.5 %}",
" {% set width=3 %}",
" {% endif %}",
" {% else %}",
" {% set width=2 %}",
@ -84,32 +84,33 @@
"width": "{{ width }}",
"color": "white",
"opacity": "1",
"lineCap": "butt",
"fill": null
}
},
"info": [
"<table>",
" {% set color = '#000000' %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ markerLine({ 'width': 3, 'color': const.colorNone })|raw }}</td>",
" <td>{{ trans('not electrified') }}</td>",
" </tr>",
"{% for i in range(0, 1000, 200) %}",
" {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}",
"{% for i in range(0, const.range[1], const.infoSteps[0]) %}",
" {% set color = colorInterpolate(const.scheme|slice(0, 2), i / const.range[1]) %}",
" <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) %}",
"{% for i in range(const.range[1] + const.infoSteps[1], const.range[2], const.infoSteps[1]) %}",
" {% set color = colorInterpolate(const.scheme|slice(1, 2), (i - const.range[1]) / (const.range[2] - const.range[1])) %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ i }}V</td>",
" </tr>",
"{% endfor %}",
"",
"{% set color = const.scheme[1] %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ trans('tag:frequency=0') }}</td>",
@ -121,14 +122,22 @@
" </tr>",
"",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': '#7f7f7f' })|raw }}</td>",
" <td>{{ markerLine({ 'width': 3, 'color': const.colorUnknown })|raw }}</td>",
" <td>{{ trans('unknown') }}</td>",
" </tr>",
"",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': '#ff0000' })|raw }}</td>",
" <td>{{ markerLine({ 'width': 3, 'color': const.colorIllegal })|raw }}</td>",
" <td>{{ trans('illegal value') }}</td>",
" </tr>",
"</table>"
]
],
"const": {
"range": [ 0, 1000, 25000 ],
"infoSteps": [ 200, 2000 ],
"scheme": [ "#00ff00", "#003fff", "#af0000" ],
"colorNone": "orange",
"colorUnknown": "#404040",
"colorIllegal": "#ff0000"
}
}
Loading…
Cancel
Save