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.

117 lines
5.3 KiB

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