Main categories of OpenStreetBrowser with support for whitewater
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.

145 lines
8.1 KiB

7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Eisenbahn Infrastruktur",
  5. "en": "Railway infrastructure"
  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. "17": "(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' ] %}",
  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' %}#ff8100{% 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": "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}",
  85. "fill": [
  86. "{% if tags.railway == 'platform' %}",
  87. "1",
  88. "{% elseif type == 'node' %}",
  89. "1",
  90. "{% else %}",
  91. "{% endif %}"
  92. ],
  93. "fillColor": [
  94. "{% if tags.railway == 'platform' %}",
  95. "#3f3f3f",
  96. "{% elseif type == 'node' %}",
  97. "#ffffff",
  98. "{% endif %}"
  99. ],
  100. "fillOpacity": [
  101. "{% if tags.railway == 'platform' %}",
  102. "0.2",
  103. "{% elseif type == 'node' %}",
  104. "0",
  105. "{% endif %}"
  106. ]
  107. },
  108. "style:casing": {
  109. "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 %}",
  110. "color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#ff8100{% 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 %}",
  111. "lineCap": "butt",
  112. "dashArray": "2,4"
  113. }
  114. },
  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. ]
  145. }