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.

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