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.

156 lines
8.6 KiB

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