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.

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