Main categories of OpenStreetBrowser with public transport zoom level
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.

146 lines
8.3 KiB

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