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.

129 lines
6.7 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. "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 width='10' height='10'>",
  27. " <circle cx='4.5' cy='4.5' r='3' style='stroke-width: 3; stroke: #000000; fill: #ffffff'>",
  28. "</svg>",
  29. "{% else %}",
  30. "{{ markerPointer({})|raw }}",
  31. "{% endif %}"
  32. ],
  33. "listMarkerSymbol": [
  34. "{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal' ] %}",
  35. "{% else %}",
  36. "line",
  37. "{% endif %}"
  38. ],
  39. "priority": [
  40. "{% if tags.railway == 'station' %}0",
  41. "{% elseif tags.railway in [ 'halt' ] %}1",
  42. "{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2",
  43. "{% elseif tags.railway in [ 'subway_entrance' ] %}3",
  44. "{% else %}5",
  45. "{% endif %}"
  46. ],
  47. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}",
  48. "style": {
  49. "weight": [
  50. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  51. "1",
  52. "{% else %}",
  53. " {% if tags.railway == 'rail' %}",
  54. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  55. " 3",
  56. " {% else %}",
  57. " 2",
  58. " {% endif %}",
  59. " {% elseif tags.railway == 'platform' %}",
  60. " 1",
  61. " {% else %}",
  62. " 2",
  63. " {% endif %}",
  64. "{% endif %}"
  65. ],
  66. "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 %}",
  67. "opacity": "1",
  68. "dashArray": "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}",
  69. "fill": [
  70. "{% if tags.railway == 'platform' %}",
  71. "1",
  72. "{% elseif type == 'node' %}",
  73. "1",
  74. "{% else %}",
  75. "{% endif %}"
  76. ],
  77. "fillColor": [
  78. "{% if tags.railway == 'platform' %}",
  79. "#3f3f3f",
  80. "{% elseif type == 'node' %}",
  81. "#ffffff",
  82. "{% endif %}"
  83. ],
  84. "fillOpacity": [
  85. "{% if tags.railway == 'platform' %}",
  86. "0.2",
  87. "{% elseif type == 'node' %}",
  88. "0",
  89. "{% endif %}"
  90. ]
  91. },
  92. "style:casing": {
  93. "weight": "{% 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 %}",
  94. "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 %}",
  95. "lineCap": "butt",
  96. "dashArray": "2,4"
  97. }
  98. },
  99. "info": [
  100. "<table>",
  101. " <tr>",
  102. " <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"main\" }))|raw }}</td>",
  103. " <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>",
  104. " </tr>",
  105. " <tr>",
  106. " <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>",
  107. " <td>{{ tagTrans('railway', 'rail') }}</td>",
  108. " </tr>",
  109. " <tr>",
  110. " <td>{{ markerLine(evaluate({ \"railway\": \"narrow_gauge\" }))|raw }}</td>",
  111. " <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>",
  112. " </tr>",
  113. " <tr>",
  114. " <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>",
  115. " <td>{{ tagTrans('railway', 'light_rail') }}</td>",
  116. " </tr>",
  117. " <tr>",
  118. " <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>",
  119. " <td>{{ tagTrans('railway', 'subway') }}</td>",
  120. " </tr>",
  121. "{% if map.zoom >= 14 %}",
  122. " <tr>",
  123. " <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>",
  124. " <td>{{ tagTrans('railway', 'tram') }}</td>",
  125. " </tr>",
  126. "{% endif %}",
  127. "</table>"
  128. ]
  129. }