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.

170 lines
5.8 KiB

  1. type: overpass
  2. query:
  3. 11: way[railway~"^(rail|narrow_gauge|subway|light_rail)$"][usage~'^(main|branch)$'];
  4. 13: way[railway~"^(rail|narrow_gauge|subway|light_rail|tram|abandoned|disused|razed)$"];
  5. feature:
  6. pre: |-
  7. {% set type = tags.railway %}
  8. {% set lifecyle = 'active' %}
  9. {% if tags.railway in ['abandoned', 'construction', 'proposed', 'disused', 'razed'] %}
  10. {% set lifecyle = tags.railway %}
  11. {% set type = attribute(tags, tags.railway)|default(attribute(tags, tags.railway ~ ':railway')) %}
  12. {% endif %}
  13. {% set width = 2 %}
  14. {% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}
  15. {% set width = 1 %}
  16. {% elseif tags.railway in ['rail', 'narrow_gauge', 'abandoned', 'disused', 'razed'] %}
  17. {% if tags.usage in ['main', 'branch'] %}
  18. {% set width = 3 %}
  19. {% else %}
  20. {% set width = 2 %}
  21. {% endif %}
  22. {% endif %}
  23. title: |-
  24. {% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}
  25. {{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}
  26. {% if attribute(tags, 'tunnel:name') %}- {{ localizedTag(tags, 'tunnel:name') }}{% endif %}
  27. {% if attribute(tags, 'bridge:name') %}- {{ localizedTag(tags, 'bridge:name') }}{% endif %}
  28. description: |-
  29. {{ tagTrans('railway', type) }}
  30. {% if lifecyle != 'active' %}
  31. ({{ tagTrans('railway', lifecyle) }})
  32. {%- endif -%}
  33. {%- if tags.usage %}
  34. , {{ tagTrans('railway=rail usage', tags.usage) }}
  35. {% endif -%}
  36. {%- if tags.service %}
  37. , {{ tagTrans('railway=rail service', tags.service) }}
  38. {% endif -%}
  39. body: |-
  40. {% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}
  41. {% if tags.usage %}{{ keyTrans('railway=rail usage') }}: {{ tagTrans('railway=rail usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}
  42. {% if tags.service %}{{ keyTrans('railway=rail service') }}: {{ tagTrans('railway=rail service', tags.service ) }}<br/>{% endif %}
  43. {{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>
  44. {% if tags.electrified == 'no' %}
  45. {{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}
  46. {% elseif tags.electrified %}
  47. {{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}
  48. {% endif %}<br/>
  49. markerSign: |-
  50. {% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X
  51. {% endif %}
  52. markerSymbol: false
  53. listMarkerSymbol: line
  54. styles: |-
  55. {% if tags.bridge and tags.bridge != 'no' %}casing_bridge,{% endif %}
  56. {% if const.color[tags.railway] %}casing,casing_layer,{% endif %}
  57. {% if tags.railway in ['abandoned', 'disused', 'razed'] %}disused,{% endif %}
  58. {% if tags.railway == 'narrow_gauge' %}default,narrow
  59. {% else %}default
  60. {% endif %}
  61. style:
  62. width: |-
  63. {{ width }}
  64. zIndex: |-
  65. {{ tags.layer|default(0) + 10 }}
  66. color: |-
  67. {% set color = const.color[type ~ '/' ~ tags.usage]|default(const.color[type]) %}
  68. {% if tags.tunnel and tags.tunnel != 'no' %}
  69. {{ colorInterpolate([ color, '#ffffff' ], 0.3) }}
  70. {% else %}
  71. {{ color }}
  72. {% endif %}
  73. opacity: 1
  74. dashArray: |-
  75. {% if tags.railway == 'disused' %}1,5
  76. {% elseif tags.railway == 'abandoned' %}1,7
  77. {% elseif tags.railway == 'razed' %}1,9
  78. {% endif %}
  79. fill: false
  80. style:disused:
  81. width: |-
  82. {{ width }}
  83. zIndex: |-
  84. {{ tags.layer|default(0) + 9.995 }}
  85. color: white
  86. opacity: 1
  87. fill: false
  88. style:casing:
  89. color: '#ffffff'
  90. pane: casing
  91. width: |-
  92. {{ width + 2 }}
  93. style:casing_layer:
  94. color: '#ffffff'
  95. zIndex: |-
  96. {{ tags.layer|default(0) + 9.99 }}
  97. width: |-
  98. {{ width + 2 }}
  99. lineCap: butt
  100. style:casing_bridge:
  101. color: '#000000'
  102. zIndex: |-
  103. {{ tags.layer|default(0) + 9.98 }}
  104. width: |-
  105. {{ width + 4 }}
  106. lineCap: butt
  107. style:narrow:
  108. width: |-
  109. {{ width + 2 }}
  110. color: |-
  111. {% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}
  112. {% if tags.usage == 'main' %}#ff8100
  113. {% elseif tags.usage == 'branch' %}#daca00
  114. {% else %}#000000
  115. {% endif %}
  116. {% elseif tags.railway == 'subway' %}#0000ff
  117. {% elseif tags.railway == 'tram' %}#ff00ff
  118. {% elseif tags.railway == 'light_rail' %}#00BD14
  119. {% elseif tags.railway == 'platform' %}#3f3f3f
  120. {% else %}#000000
  121. {% endif %}
  122. lineCap: butt
  123. dashArray: '2,4'
  124. info: |-
  125. <table>
  126. <tr>
  127. <td>{{ markerLine(evaluate({ "railway": "rail", "usage": "main" }))|raw }}</td>
  128. <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>
  129. </tr>
  130. <tr>
  131. <td>{{ markerLine(evaluate({ "railway": "rail" }))|raw }}</td>
  132. <td>{{ tagTrans('railway', 'rail') }}</td>
  133. </tr>
  134. <tr>
  135. <td>{{ markerLine(evaluate({ "railway": "narrow_gauge" }))|raw }}</td>
  136. <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>
  137. </tr>
  138. <tr>
  139. <td>{{ markerLine(evaluate({ "railway": "light_rail" }))|raw }}</td>
  140. <td>{{ tagTrans('railway', 'light_rail') }}</td>
  141. </tr>
  142. <tr>
  143. <td>{{ markerLine(evaluate({ "railway": "subway" }))|raw }}</td>
  144. <td>{{ tagTrans('railway', 'subway') }}</td>
  145. </tr>
  146. {% if map.zoom >= 14 %}
  147. <tr>
  148. <td>{{ markerLine(evaluate({ "railway": "tram" }))|raw }}</td>
  149. <td>{{ tagTrans('railway', 'tram') }}</td>
  150. </tr>
  151. {% endif %}
  152. </table>
  153. const:
  154. color:
  155. rail: '#000000'
  156. rail/main: '#ff8100'
  157. rail/branch: '#daca00'
  158. subway: '#0000ff'
  159. tram: '#ff00ff'
  160. light_rail: '#00BD14'
  161. platform: '#3f3f3f'
  162. default: '#000000'