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.

175 lines
5.6 KiB

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