diff --git a/railway-electrification.json b/railway-electrification.json index f54ba20c..f116ad1b 100644 --- a/railway-electrification.json +++ b/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) %}", "