Browse Source

improvements

fossil
parent
commit
5b03046545
  1. 20
      railway-electrification.json
  2. 7
      railway-infrastructure.json

20
railway-electrification.json

@ -5,39 +5,31 @@
"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)$'];"
"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' %}\n {% if tags.voltage < 1000 %}\n {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}\n {% else %}\n {% set color = colorInterpolate([ 'blue', 'red' ], (tags.voltage - 1000) / 24000) %}\n {% endif %}\n{% else %}\n {% set color='black' %}\n{%endif %}\n\n{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}\n {% set weight=2 %}\n {% else %}\n {% if tags.railway == 'rail' %}\n {% if tags.usage == 'main' or tags.usage == 'branch' %}\n {% set weight=3 %}\n {% else %}\n {% set weight=2.5 %}\n {% endif %}\n {% else %}\n {% set weight=2 %}\n {% endif %}\n{% endif %}",
"style:casing": {
"weight": "{{ weight + 2 }}",
"color": "{{ color }}",
"dashArray": "2,4",
"lineCap": "butt"
},
"style": {
"color": "white",
"weight": "{{ weight }}",
"fill": null,
"opacity": "1"
},
"style:highlight": {
"style": {
"color": "{{ color }}",
"weight": "{{ weight }}",
"dashArray": "{% if not tags.electrified or tags.electrified == 'no' %}\n{% elseif tags.frequency == 0 %}\n{% else %}\n5,2\n{% 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 %}",
"styles": "casing,default",
"markerSign": null,
"body": "{{ tagTrans('railway', tags.railway) }}<br/>\n{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>\n{% 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 %}\n",
"description": "{{ tagTrans('railway', tags.railway) }} -\n\n{% if tags.electrified == 'no' %}\n {{ trans('not electrified') }}\n{% elseif tags.electrified %}\n {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz\n{% 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')) }}",
"listMarkerSymbol": "{{ markerLine({ 'weight': 3, 'color': color })|raw }}"
"listMarkerSymbol": "line"
},
"info": "<table>\n{% for i in range(0, 1000, 200) %}\n {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n\n{% for i in range(3000, 25000, 2000) %}\n {% set color = colorInterpolate([ 'blue', 'red' ], (i - 1000) / 24000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n</table>"
"info": "<table>\n {% set color = '#000000' %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ trans('not electrified') }}</td>\n </tr>\n{% for i in range(0, 1000, 200) %}\n {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n\n{% for i in range(3000, 25000, 2000) %}\n {% set color = colorInterpolate([ 'blue', 'red' ], (i - 1000) / 24000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ trans('direct current') }}</td>\n </tr>\n\n <tr>\n <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'weight': 3, 'color': 'white' }, 'style': { 'weight': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>\n <td>{{ trans('alternating current') }}</td>\n </tr>\n</table>"
}

7
railway-infrastructure.json

@ -26,12 +26,13 @@
"fillOpacity": "{% if tags.railway == 'platform' %}\n0.2\n{% elseif type == 'node' %}\n0\n{% endif %}"
},
"styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}",
"markerSign": null,
"markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X{% endif %}",
"body": "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>\n{% 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 %}\n",
"description": "{{ tagTrans('railway', tags.railway) }}",
"priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
"priority": "{% if tags.railway == 'station' %}0\n{% elseif tags.railway in [ 'halt' ] %}1\n{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2\n{% elseif tags.railway in [ 'subway_entrance' ] %}3\n{% else %}5\n{% endif %}",
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
"listMarkerSymbol": "{% if tags.railway == 'station' %}\narea\n{% else %}\nline\n{% endif %}"
"listMarkerSymbol": "{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal' ] %}\n{% else %}\nline\n{% endif %}",
"markerSymbol": "{% if tags.railway == 'signal' %}\n<svg width='10' height='10'>\n <circle cx='4.5' cy='4.5' r='3' style='stroke-width: 3; stroke: #000000; fill: #ffffff'>\n</svg>\n{% else %}\n{{ markerPointer({})|raw }}\n{% endif %}"
},
"info": "<table>\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"main\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>\n </tr>\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'rail') }}</td>\n </tr>\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"narrow_gauge\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>\n </tr>\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'light_rail') }}</td>\n </tr>\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'subway') }}</td>\n </tr>\n{{ console_log(map) }}\n{% if map.zoom >= 14 %}\n <tr>\n <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>\n <td>{{ tagTrans('railway', 'tram') }}</td>\n </tr>\n{% endif %}\n</table>"
}
Loading…
Cancel
Save