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.

114 lines
6.4 KiB

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