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
5.1 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Eisenbahn Elektrifizierung",
  5. "en": "Railway electrification"
  6. },
  7. "query": {
  8. "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];",
  9. "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'];"
  10. },
  11. "feature": {
  12. "pre": [
  13. "{% if tags.electrified and tags.electrified != 'no' %}",
  14. " {% if tags.voltage < 1000 %}",
  15. " {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}",
  16. " {% else %}",
  17. " {% set color = colorInterpolate([ 'blue', 'red' ], (tags.voltage - 1000) / 24000) %}",
  18. " {% endif %}",
  19. "{% else %}",
  20. " {% set color='black' %}",
  21. "{%endif %}",
  22. "",
  23. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  24. " {% set weight=2 %}",
  25. " {% else %}",
  26. " {% if tags.railway == 'rail' %}",
  27. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  28. " {% set weight=3 %}",
  29. " {% else %}",
  30. " {% set weight=2.5 %}",
  31. " {% endif %}",
  32. " {% else %}",
  33. " {% set weight=2 %}",
  34. " {% endif %}",
  35. "{% endif %}"
  36. ],
  37. "style:casing": {
  38. "color": "white",
  39. "weight": "{{ weight }}",
  40. "fill": null,
  41. "opacity": "1"
  42. },
  43. "style": {
  44. "color": "{{ color }}",
  45. "weight": "{{ weight }}",
  46. "dashArray": [
  47. "{% if not tags.electrified or tags.electrified == 'no' %}",
  48. "{% elseif tags.frequency == 0 %}",
  49. "{% else %}",
  50. "5,2",
  51. "{% endif %}"
  52. ],
  53. "opacity": "1",
  54. "lineCap": "butt"
  55. },
  56. "styles": "casing,default",
  57. "markerSign": null,
  58. "body": [
  59. "{{ tagTrans('railway', tags.railway) }}<br/>",
  60. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  61. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  62. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  63. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  64. "{% 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 %}",
  65. ""
  66. ],
  67. "description": [
  68. "{{ tagTrans('railway', tags.railway) }} -",
  69. "",
  70. "{% if tags.electrified == 'no' %}",
  71. " {{ trans('not electrified') }}",
  72. "{% elseif tags.electrified %}",
  73. " {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
  74. "{% endif %}"
  75. ],
  76. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  77. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  78. "listMarkerSymbol": "line"
  79. },
  80. "info": [
  81. "<table>",
  82. " {% set color = '#000000' %}",
  83. " <tr>",
  84. " <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>",
  85. " <td>{{ trans('not electrified') }}</td>",
  86. " </tr>",
  87. "{% for i in range(0, 1000, 200) %}",
  88. " {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}",
  89. " <tr>",
  90. " <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>",
  91. " <td>{{ i }}V</td>",
  92. " </tr>",
  93. "{% endfor %}",
  94. "",
  95. "{% for i in range(3000, 25000, 2000) %}",
  96. " {% set color = colorInterpolate([ 'blue', 'red' ], (i - 1000) / 24000) %}",
  97. " <tr>",
  98. " <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>",
  99. " <td>{{ i }}V</td>",
  100. " </tr>",
  101. "{% endfor %}",
  102. "",
  103. " <tr>",
  104. " <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>",
  105. " <td>{{ trans('direct current') }}</td>",
  106. " </tr>",
  107. "",
  108. " <tr>",
  109. " <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'weight': 3, 'color': 'white' }, 'style': { 'weight': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>",
  110. " <td>{{ trans('alternating current') }}</td>",
  111. " </tr>",
  112. "</table>"
  113. ]
  114. }