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.

147 lines
8.2 KiB

7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Railway infrastructure",
  5. "de": "Eisenbahn Infrastruktur"
  6. },
  7. "query": {
  8. "11": "(way[railway=rail][usage~'^(main|branch)$'];node[railway~'^(station)$'];)",
  9. "14": "(way[railway];node[railway~'^(station|halt|tram_stop)$'];)",
  10. "18": "(node[railway];way[railway];)"
  11. },
  12. "feature": {
  13. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  14. "description": "{{ tagTrans('railway', tags.railway) }}",
  15. "body": [
  16. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  17. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  18. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  19. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  20. "{% 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 %}",
  21. ""
  22. ],
  23. "markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X{% endif %}",
  24. "markerSymbol": [
  25. "{% if tags.railway == 'signal' %}",
  26. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  27. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />",
  28. " <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>",
  29. " <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>",
  30. "</svg>",
  31. "{% elseif tags.railway == 'switch' %}",
  32. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  33. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />",
  34. " <line x1='2' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  35. " <line x1='2' x2='7' y1='10' y2='2' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  36. "</svg>",
  37. "{% elseif tags.railway == 'railway_crossing' %}",
  38. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  39. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />",
  40. " <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  41. " <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  42. "</svg>",
  43. "{% elseif tags.railway not in [ 'rail', 'tram', 'subway', 'narrow_gauge', 'abandoned', 'disused', 'light_rail' ] %}",
  44. "{{ markerPointer({})|raw }}",
  45. "{% endif %}"
  46. ],
  47. "listMarkerSymbol": [
  48. "{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal', 'switch', 'railway_crossing' ] %}",
  49. "{% else %}",
  50. "line",
  51. "{% endif %}"
  52. ],
  53. "priority": [
  54. "{% if tags.railway == 'station' %}0",
  55. "{% elseif tags.railway in [ 'halt' ] %}1",
  56. "{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2",
  57. "{% elseif tags.railway in [ 'subway_entrance' ] %}3",
  58. "{% else %}5",
  59. "{% endif %}"
  60. ],
  61. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}",
  62. "style": {
  63. "width": [
  64. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  65. "1",
  66. "{% else %}",
  67. " {% if tags.railway == 'rail' %}",
  68. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  69. " 3",
  70. " {% else %}",
  71. " 2",
  72. " {% endif %}",
  73. " {% elseif tags.railway == 'platform' %}",
  74. " 1",
  75. " {% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}",
  76. " 0",
  77. " {% else %}",
  78. " 2",
  79. " {% endif %}",
  80. "{% endif %}"
  81. ],
  82. "color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#000000{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}",
  83. "opacity": "1",
  84. "dashArray": [
  85. "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}",
  86. "{% if tags.tunnel %}5,5{% endif %}"
  87. ],
  88. "fill": [
  89. "{% if tags.railway == 'platform' %}",
  90. "1",
  91. "{% elseif type == 'node' %}",
  92. "1",
  93. "{% else %}",
  94. "{% endif %}"
  95. ],
  96. "fillColor": [
  97. "{% if tags.railway == 'platform' %}",
  98. "#3f3f3f",
  99. "{% elseif type == 'node' %}",
  100. "#ffffff",
  101. "{% endif %}"
  102. ],
  103. "fillOpacity": [
  104. "{% if tags.railway == 'platform' %}",
  105. "0.2",
  106. "{% elseif type == 'node' %}",
  107. "0",
  108. "{% endif %}"
  109. ]
  110. },
  111. "style:casing": {
  112. "width": "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}5{% else %}{% if tags.railway == 'rail' %}{% if tags.usage == 'main' or tags.usage == 'branch' %}7{% else %}6{% endif %}{% elseif tags.railway == 'platform' %}5{% else %}6{% endif %}{% endif %}",
  113. "color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#000000{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}",
  114. "lineCap": "butt",
  115. "dashArray": "2,4"
  116. }
  117. },
  118. "info": [
  119. "<table>",
  120. " <tr>",
  121. " <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"main\" }))|raw }}</td>",
  122. " <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>",
  123. " </tr>",
  124. " <tr>",
  125. " <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>",
  126. " <td>{{ tagTrans('railway', 'rail') }}</td>",
  127. " </tr>",
  128. " <tr>",
  129. " <td>{{ markerLine(evaluate({ \"railway\": \"narrow_gauge\" }))|raw }}</td>",
  130. " <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>",
  131. " </tr>",
  132. " <tr>",
  133. " <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>",
  134. " <td>{{ tagTrans('railway', 'light_rail') }}</td>",
  135. " </tr>",
  136. " <tr>",
  137. " <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>",
  138. " <td>{{ tagTrans('railway', 'subway') }}</td>",
  139. " </tr>",
  140. "{% if map.zoom >= 14 %}",
  141. " <tr>",
  142. " <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>",
  143. " <td>{{ tagTrans('railway', 'tram') }}</td>",
  144. " </tr>",
  145. "{% endif %}",
  146. "</table>"
  147. ]
  148. }