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.

134 lines
6.1 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~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];"
  14. },
  15. "feature": {
  16. "pre": [
  17. "{% if tags.electrified and tags.electrified != 'no' %}",
  18. " {% if not tags.voltage is defined %}",
  19. " {% set color = '#7f7f7f' %}",
  20. " {% elseif not tags.voltage|matches('^[0-9]+$') %}",
  21. " {% set color = '#ff0000' %}",
  22. " {% elseif tags.voltage < 1000 %}",
  23. " {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}",
  24. " {% else %}",
  25. " {% set color = colorInterpolate([ 'blue', '#af0000' ], (tags.voltage - 1000) / 24000) %}",
  26. " {% endif %}",
  27. "{% elseif tags.electrified and tags.electrified == 'no' %}",
  28. " {% set color = '#000000' %}",
  29. "{% else %}",
  30. " {% set color = '#7f7f7f' %}",
  31. "{% endif %}",
  32. "",
  33. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  34. " {% set width=2 %}",
  35. " {% else %}",
  36. " {% if tags.railway == 'rail' %}",
  37. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  38. " {% set width=3 %}",
  39. " {% else %}",
  40. " {% set width=2.5 %}",
  41. " {% endif %}",
  42. " {% else %}",
  43. " {% set width=2 %}",
  44. " {% endif %}",
  45. "{% endif %}"
  46. ],
  47. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  48. "description": [
  49. "{{ tagTrans('railway', tags.railway) }}",
  50. "",
  51. "{% if tags.electrified == 'no' %}",
  52. " - {{ tagTrans('electrified', 'no') }}",
  53. "{% elseif tags.electrified %}",
  54. " - {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
  55. "{% endif %}"
  56. ],
  57. "body": [
  58. "{{ tagTrans('railway', tags.railway) }}<br/>",
  59. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  60. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  61. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  62. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  63. "{% 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 %}"
  64. ],
  65. "markerSymbol": null,
  66. "listMarkerSymbol": "line",
  67. "styles": "casing,default",
  68. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  69. "style": {
  70. "width": "{{ width }}",
  71. "lineCap": "butt",
  72. "color": "{{ color }}",
  73. "opacity": "1",
  74. "fill": null,
  75. "dashArray": [
  76. "{% if not tags.electrified is defined %}",
  77. "{% elseif not tags.frequency is defined or tags.frequency == 0 %}",
  78. "{% else %}",
  79. "5,2",
  80. "{% endif %}"
  81. ]
  82. },
  83. "style:casing": {
  84. "width": "{{ width }}",
  85. "color": "white",
  86. "opacity": "1",
  87. "fill": null
  88. }
  89. },
  90. "info": [
  91. "<table>",
  92. " {% set color = '#000000' %}",
  93. " <tr>",
  94. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  95. " <td>{{ trans('not electrified') }}</td>",
  96. " </tr>",
  97. "{% for i in range(0, 1000, 200) %}",
  98. " {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}",
  99. " <tr>",
  100. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  101. " <td>{{ i }}V</td>",
  102. " </tr>",
  103. "{% endfor %}",
  104. "",
  105. "{% for i in range(3000, 25000, 2000) %}",
  106. " {% set color = colorInterpolate([ 'blue', '#af0000' ], (i - 1000) / 24000) %}",
  107. " <tr>",
  108. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  109. " <td>{{ i }}V</td>",
  110. " </tr>",
  111. "{% endfor %}",
  112. "",
  113. " <tr>",
  114. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  115. " <td>{{ trans('tag:frequency=0') }}</td>",
  116. " </tr>",
  117. "",
  118. " <tr>",
  119. " <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'width': 3, 'color': 'white' }, 'style': { 'width': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>",
  120. " <td>{{ trans('tag:frequency>0') }}</td>",
  121. " </tr>",
  122. "",
  123. " <tr>",
  124. " <td>{{ markerLine({ 'width': 3, 'color': '#7f7f7f' })|raw }}</td>",
  125. " <td>{{ trans('unknown') }}</td>",
  126. " </tr>",
  127. "",
  128. " <tr>",
  129. " <td>{{ markerLine({ 'width': 3, 'color': '#ff0000' })|raw }}</td>",
  130. " <td>{{ trans('illegal value') }}</td>",
  131. " </tr>",
  132. "</table>"
  133. ]
  134. }