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.

165 lines
7.2 KiB

7 years ago
7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "ca": "Electrificació de la via fèrria",
  5. "cs": "Elektrifikovaná železnice",
  6. "de": "Eisenbahn Elektrifizierung",
  7. "en": "Railway electrification",
  8. "es": "Electrificación ferroviaria",
  9. "fr": "Puissance électrique ferroviaire",
  10. "gl": "Ferrocarril electrificado",
  11. "hu": "Vasút villamosítottsága",
  12. "it": "Elettrificazione ferroviaria",
  13. "ja": "鉄道の電力",
  14. "nb": "Jernbane-strømtilførsel",
  15. "nl": "Spoorwegelektrificatie",
  16. "oc": "Electrificacion ferroviària",
  17. "pl": "Elektryfikacja kolei",
  18. "pt": "Eletrificação ferroviária",
  19. "pt-br": "Eletrificação ferroviária",
  20. "ru": "Электрификация железных дорог",
  21. "tr": "Demiryolu elektrifikasyonu"
  22. },
  23. "query": {
  24. "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];",
  25. "14": "way[railway~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];"
  26. },
  27. "feature": {
  28. "pre": [
  29. "{% if tags.electrified and tags.electrified != 'no' %}",
  30. " {% if not tags.voltage is defined %}",
  31. " {% set color = const.colorUnknown %}",
  32. " {% elseif not tags.voltage|matches('^[0-9]+$') %}",
  33. " {% set color = const.colorIllegal %}",
  34. " {% elseif tags.voltage < const.range[1] %}",
  35. " {% set color = colorInterpolate(const.scheme|slice(0, 2), tags.voltage / const.range[1]) %}",
  36. " {% else %}",
  37. " {% set color = colorInterpolate(const.scheme|slice(1, 2), (tags.voltage - const.range[1]) / (const.range[2] - const.range[1])) %}",
  38. " {% endif %}",
  39. "{% elseif tags.electrified and tags.electrified == 'no' %}",
  40. " {% set color = const.colorNone %}",
  41. "{% else %}",
  42. " {% set color = const.colorUnknown %}",
  43. "{% endif %}",
  44. "",
  45. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  46. " {% set width=2 %}",
  47. " {% else %}",
  48. " {% if tags.railway == 'rail' %}",
  49. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  50. " {% set width=4 %}",
  51. " {% else %}",
  52. " {% set width=3 %}",
  53. " {% endif %}",
  54. " {% else %}",
  55. " {% set width=2 %}",
  56. " {% endif %}",
  57. "{% endif %}"
  58. ],
  59. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}",
  60. "description": "{{ tagTrans('railway', tags.railway) }}",
  61. "details": [
  62. "{% if tags.electrified == 'no' %}",
  63. "{{ tagTrans('electrified', 'no') }}",
  64. "{% elseif tags.electrified %}",
  65. "{{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
  66. "{% endif %}"
  67. ],
  68. "body": [
  69. "{{ tagTrans('railway', tags.railway) }}<br/>",
  70. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  71. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  72. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  73. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  74. "{% 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 %}"
  75. ],
  76. "markerSymbol": null,
  77. "listMarkerSymbol": "line",
  78. "styles": "casing,default",
  79. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  80. "style": {
  81. "width": "{{ width }}",
  82. "lineCap": "butt",
  83. "color": "{{ color }}",
  84. "opacity": "1",
  85. "fill": null,
  86. "dashArray": [
  87. "{% if not tags.electrified is defined %}",
  88. "{% elseif not tags.frequency is defined or tags.frequency == 0 %}",
  89. "{% else %}",
  90. "5,2",
  91. "{% endif %}"
  92. ]
  93. },
  94. "style:casing": {
  95. "width": "{{ width }}",
  96. "color": "white",
  97. "opacity": "1",
  98. "lineCap": "butt",
  99. "fill": null
  100. }
  101. },
  102. "info": [
  103. "<table>",
  104. " <tr>",
  105. " <td>{{ markerLine({ 'width': 3, 'color': const.colorNone })|raw }}</td>",
  106. " <td>{{ trans('not electrified') }}</td>",
  107. " </tr>",
  108. "{% for i in range(0, const.range[1], const.infoSteps[0]) %}",
  109. " {% set color = colorInterpolate(const.scheme|slice(0, 2), i / const.range[1]) %}",
  110. " <tr>",
  111. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  112. " <td>{{ i }}V</td>",
  113. " </tr>",
  114. "{% endfor %}",
  115. "",
  116. "{% for i in range(const.range[1] + const.infoSteps[1], const.range[2], const.infoSteps[1]) %}",
  117. " {% set color = colorInterpolate(const.scheme|slice(1, 2), (i - const.range[1]) / (const.range[2] - const.range[1])) %}",
  118. " <tr>",
  119. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  120. " <td>{{ i }}V</td>",
  121. " </tr>",
  122. "{% endfor %}",
  123. "",
  124. "{% set color = const.scheme[1] %}",
  125. " <tr>",
  126. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  127. " <td>{{ trans('tag:frequency=0') }}</td>",
  128. " </tr>",
  129. "",
  130. " <tr>",
  131. " <td>{{ markerLine({ 'styles': [ 'casing', 'default' ], 'style:casing': { 'width': 3, 'color': 'white' }, 'style': { 'width': '3', 'dashArray': '5,2', 'lineCap': 'butt', 'color': color } })|raw }}</td>",
  132. " <td>{{ trans('tag:frequency>0') }}</td>",
  133. " </tr>",
  134. "",
  135. " <tr>",
  136. " <td>{{ markerLine({ 'width': 3, 'color': const.colorUnknown })|raw }}</td>",
  137. " <td>{{ trans('unknown') }}</td>",
  138. " </tr>",
  139. "",
  140. " <tr>",
  141. " <td>{{ markerLine({ 'width': 3, 'color': const.colorIllegal })|raw }}</td>",
  142. " <td>{{ trans('illegal value') }}</td>",
  143. " </tr>",
  144. "</table>"
  145. ],
  146. "const": {
  147. "range": [
  148. 0,
  149. 1000,
  150. 25000
  151. ],
  152. "infoSteps": [
  153. 200,
  154. 2000
  155. ],
  156. "scheme": [
  157. "#00ff00",
  158. "#003fff",
  159. "#af0000"
  160. ],
  161. "colorNone": "orange",
  162. "colorUnknown": "#404040",
  163. "colorIllegal": "#ff0000"
  164. }
  165. }