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.

148 lines
8.2 KiB

5 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('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  21. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('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. ],
  26. "markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X{% endif %}",
  27. "markerSymbol": [
  28. "{% if tags.railway == 'signal' %}",
  29. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  30. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />",
  31. " <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>",
  32. " <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>",
  33. "</svg>",
  34. "{% elseif tags.railway == 'switch' %}",
  35. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  36. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />",
  37. " <line x1='2' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  38. " <line x1='2' x2='7' y1='10' y2='2' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  39. "</svg>",
  40. "{% elseif tags.railway == 'railway_crossing' %}",
  41. "<svg anchorX='5' anchorY='8' width='9' height='15'>",
  42. " <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />",
  43. " <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  44. " <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>",
  45. "</svg>",
  46. "{% elseif tags.railway not in [ 'rail', 'tram', 'subway', 'narrow_gauge', 'abandoned', 'disused' ] %}",
  47. "{{ markerPointer({})|raw }}",
  48. "{% endif %}"
  49. ],
  50. "listMarkerSymbol": [
  51. "{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal', 'switch', 'railway_crossing' ] %}",
  52. "{% else %}",
  53. "line",
  54. "{% endif %}"
  55. ],
  56. "priority": [
  57. "{% if tags.railway == 'station' %}0",
  58. "{% elseif tags.railway in [ 'halt' ] %}1",
  59. "{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2",
  60. "{% elseif tags.railway in [ 'subway_entrance' ] %}3",
  61. "{% else %}5",
  62. "{% endif %}"
  63. ],
  64. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}",
  65. "style": {
  66. "width": [
  67. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  68. "1",
  69. "{% else %}",
  70. " {% if tags.railway == 'rail' %}",
  71. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  72. " 3",
  73. " {% else %}",
  74. " 2",
  75. " {% endif %}",
  76. " {% elseif tags.railway == 'platform' %}",
  77. " 1",
  78. " {% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}",
  79. " 0",
  80. " {% else %}",
  81. " 2",
  82. " {% endif %}",
  83. "{% endif %}"
  84. ],
  85. "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 %}",
  86. "opacity": "1",
  87. "dashArray": "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}",
  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' %}#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 %}",
  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. }