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.

115 lines
5.2 KiB

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