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.

155 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: |-
  55. {% if tags.ref %}{{ localizedTag(tags, "ref") }} - {% endif %}{{ localizedTag(tags, "name")|default(localizedTag(tags, "operator")) }}
  56. description: |-
  57. {{ tagTrans("railway", tags.railway) }}
  58. details: |-
  59. {% if tags.electrified == 'no' %}
  60. {{ tagTrans('electrified', 'no') }}
  61. {% elseif tags.electrified %}
  62. {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz
  63. {% endif %}
  64. body: |-
  65. {{ tagTrans('railway', tags.railway) }}<br/>
  66. {% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}
  67. {% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}
  68. {% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}
  69. {{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>
  70. {% 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 %}
  71. markerSymbol: null
  72. listMarkerSymbol: line
  73. styles: casing,default
  74. priority: |-
  75. {% if tags.railway == "station" %}0
  76. {% elseif tags.railway in [ "halt", "tram_stop" ] %}1
  77. {% else %}5
  78. {% endif %}
  79. style:
  80. width: '{{ width }}'
  81. lineCap: butt
  82. color: '{{ color }}'
  83. opacity: '1'
  84. fill: null
  85. dashArray: |-
  86. {% if not tags.electrified is defined %}
  87. {% elseif not tags.frequency is defined or tags.frequency == 0 %}
  88. {% else %}
  89. 5,2
  90. {% endif %}
  91. style:casing:
  92. width: '{{ width }}'
  93. color: white
  94. opacity: '1'
  95. lineCap: butt
  96. fill: null
  97. info: |-
  98. <table>
  99. <tr>
  100. <td>{{ markerLine({ 'width': 3, 'color': const.colorNone })|raw }}</td>
  101. <td>{{ trans('not electrified') }}</td>
  102. </tr>
  103. {% for i in range(0, const.range[1], const.infoSteps[0]) %}
  104. {% set color = colorInterpolate(const.scheme|slice(0, 2), i / const.range[1]) %}
  105. <tr>
  106. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  107. <td>{{ i }}V</td>
  108. </tr>
  109. {% endfor %}
  110. {% for i in range(const.range[1] + const.infoSteps[1], const.range[2], const.infoSteps[1]) %}
  111. {% set color = colorInterpolate(const.scheme|slice(1, 2), (i - const.range[1]) / (const.range[2] - const.range[1])) %}
  112. <tr>
  113. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  114. <td>{{ i }}V</td>
  115. </tr>
  116. {% endfor %}
  117. {% set color = const.scheme[1] %}
  118. <tr>
  119. <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>
  120. <td>{{ trans('tag:frequency=0') }}</td>
  121. </tr>
  122. <tr>
  123. <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'width': 3, 'color': 'white' }, 'style': { 'width': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>
  124. <td>{{ trans('tag:frequency>0') }}</td>
  125. </tr>
  126. <tr>
  127. <td>{{ markerLine({ 'width': 3, 'color': const.colorUnknown })|raw }}</td>
  128. <td>{{ trans('unknown') }}</td>
  129. </tr>
  130. <tr>
  131. <td>{{ markerLine({ 'width': 3, 'color': const.colorIllegal })|raw }}</td>
  132. <td>{{ trans('illegal value') }}</td>
  133. </tr>
  134. </table>
  135. const:
  136. range:
  137. - 0
  138. - 1000
  139. - 25000
  140. infoSteps:
  141. - 200
  142. - 2000
  143. scheme:
  144. - '#00ff00'
  145. - '#003fff'
  146. - '#af0000'
  147. colorNone: orange
  148. colorUnknown: '#404040'
  149. colorIllegal: '#ff0000'