Browse Source

railway-electrification: check illegal values

aboriginal_lands
parent
commit
744d1807e4
  1. 26
      railway-electrification.json

26
railway-electrification.json

@ -15,14 +15,18 @@
"feature": {
"pre": [
"{% if tags.electrified and tags.electrified != 'no' %}",
" {% if tags.voltage < 1000 %}",
" {% 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', 'red' ], (tags.voltage - 1000) / 24000) %}",
" {% set color = colorInterpolate([ 'blue', '#af0000' ], (tags.voltage - 1000) / 24000) %}",
" {% endif %}",
"{% else %}",
" {% set color='black' %}",
"{%endif %}",
" {% set color = 'black' %}",
"{% endif %}",
"",
"{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
" {% set width=2 %}",
@ -67,7 +71,7 @@
"opacity": "1",
"fill": null,
"dashArray": [
"{% if not tags.electrified or tags.electrified == 'no' %}",
"{% if not tags.electrified is defined %}",
"{% elseif tags.frequency == 0 %}",
"{% else %}",
"5,2",
@ -97,7 +101,7 @@
"{% endfor %}",
"",
"{% for i in range(3000, 25000, 2000) %}",
" {% set color = colorInterpolate([ 'blue', 'red' ], (i - 1000) / 24000) %}",
" {% set color = colorInterpolate([ 'blue', '#af0000' ], (i - 1000) / 24000) %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ i }}V</td>",
@ -113,6 +117,16 @@
" <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('alternating current') }}</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>"
]
}
Loading…
Cancel
Save