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.

149 lines
5.6 KiB

  1. type: overpass
  2. name:
  3. ca: Electrificació de la via fèrria
  4. cs: Elektrifikovaná železnice
  5. de: Eisenbahn Elektrifizierung
  6. en: Railway electrification
  7. es: Electrificación ferroviaria
  8. fr: Puissance électrique ferroviaire
  9. gl: Ferrocarril electrificado
  10. hu: Vasút villamosítottsága
  11. it: Elettrificazione ferroviaria
  12. ja: 鉄道の電力
  13. nb: Jernbane-strømtilførsel
  14. nl: Spoorwegelektrificatie
  15. oc: Electrificacion ferroviària
  16. pl: Elektryfikacja kolei
  17. pt: Eletrificação ferroviária
  18. pt-br: Eletrificação ferroviária
  19. ru: Электрификация железных дорог
  20. tr: Demiryolu elektrifikasyonu
  21. query:
  22. 11: way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];
  23. 14: way[railway~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];
  24. feature:
  25. pre: |-
  26. {% if tags.electrified and tags.electrified != 'no' %}
  27. {% if not tags.voltage is defined %}
  28. {% set color = const.colorUnknown %}
  29. {% elseif not tags.voltage|matches('^[0-9]+$') %}
  30. {% set color = const.colorIllegal %}
  31. {% elseif tags.voltage < const.range[1] %}
  32. {% set color = colorInterpolate(const.scheme|slice(0, 2), tags.voltage / const.range[1]) %}
  33. {% else %}
  34. {% set color = colorInterpolate(const.scheme|slice(1, 2), (tags.voltage - const.range[1]) / (const.range[2] - const.range[1])) %}
  35. {% endif %}
  36. {% elseif tags.electrified and tags.electrified == 'no' %}
  37. {% set color = const.colorNone %}
  38. {% else %}
  39. {% set color = const.colorUnknown %}
  40. {% endif %}
  41. {% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}
  42. {% set width=2 %}
  43. {% else %}
  44. {% if tags.railway == 'rail' %}
  45. {% if tags.usage == 'main' or tags.usage == 'branch' %}
  46. {% set width=4 %}
  47. {% else %}
  48. {% set width=3 %}
  49. {% endif %}
  50. {% else %}
  51. {% set width=2 %}
  52. {% endif %}
  53. {% endif %}
  54. title: '{% if tags.ref %}{{ localizedTag(tags, ''ref'') }} - {% endif %}{{ localizedTag(tags, ''name'')|default(localizedTag(tags, ''operator'')) }}'
  55. description: '{{ tagTrans(''railway'', tags.railway) }}'
  56. details: |-
  57. {% if tags.electrified == 'no' %}
  58. {{ tagTrans('electrified', 'no') }}
  59. {% elseif tags.electrified %}
  60. {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz
  61. {% endif %}
  62. body: |-
  63. {{ tagTrans('railway', tags.railway) }}<br/>
  64. {% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}
  65. {% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}
  66. {% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}
  67. {{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>
  68. {% 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 %}
  69. markerSymbol: null
  70. listMarkerSymbol: line
  71. styles: casing,default
  72. priority: '{% if tags.railway == ''station'' %}0{% elseif tags.railway in [ ''halt'', ''tram_stop'' ] %}1{% else %}5{% endif %}'
  73. style:
  74. width: '{{ width }}'
  75. lineCap: butt
  76. color: '{{ color }}'
  77. opacity: '1'
  78. fill: null
  79. dashArray: |-
  80. {% if not tags.electrified is defined %}
  81. {% elseif not tags.frequency is defined or tags.frequency == 0 %}
  82. {% else %}
  83. 5,2
  84. {% endif %}
  85. style:casing:
  86. width: '{{ width }}'
  87. color: white
  88. opacity: '1'
  89. lineCap: butt
  90. fill: null
  91. info: |-
  92. <table>
  93. <tr>
  94. <td>{{ markerLine({ 'width': 3, 'color': const.colorNone })|raw }}</td>
  95. <td>{{ trans('not electrified') }}</td>
  96. </tr>
  97. {% for i in range(0, const.range[1], const.infoSteps[0]) %}
  98. {% set color = colorInterpolate(const.scheme|slice(0, 2), i / const.range[1]) %}
  99. <tr>
  100. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  101. <td>{{ i }}V</td>
  102. </tr>
  103. {% endfor %}
  104. {% for i in range(const.range[1] + const.infoSteps[1], const.range[2], const.infoSteps[1]) %}
  105. {% set color = colorInterpolate(const.scheme|slice(1, 2), (i - const.range[1]) / (const.range[2] - const.range[1])) %}
  106. <tr>
  107. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  108. <td>{{ i }}V</td>
  109. </tr>
  110. {% endfor %}
  111. {% set color = const.scheme[1] %}
  112. <tr>
  113. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  114. <td>{{ trans('tag:frequency=0') }}</td>
  115. </tr>
  116. <tr>
  117. <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'width': 3, 'color': 'white' }, 'style': { 'width': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>
  118. <td>{{ trans('tag:frequency>0') }}</td>
  119. </tr>
  120. <tr>
  121. <td>{{ markerLine({ 'width': 3, 'color': const.colorUnknown })|raw }}</td>
  122. <td>{{ trans('unknown') }}</td>
  123. </tr>
  124. <tr>
  125. <td>{{ markerLine({ 'width': 3, 'color': const.colorIllegal })|raw }}</td>
  126. <td>{{ trans('illegal value') }}</td>
  127. </tr>
  128. </table>
  129. const:
  130. range:
  131. - 0
  132. - 1000
  133. - 25000
  134. infoSteps:
  135. - 200
  136. - 2000
  137. scheme:
  138. - '#00ff00'
  139. - '#003fff'
  140. - '#af0000'
  141. colorNone: orange
  142. colorUnknown: '#404040'
  143. colorIllegal: '#ff0000'