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.

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