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.

86 lines
4.1 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Eisenbahn Elektrifizierung",
  5. "en": "Railway electrification"
  6. },
  7. "query": {
  8. "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed)$'][usage~'^(main|branch)$'];",
  9. "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed)$'];"
  10. },
  11. "feature": {
  12. "pre": [
  13. "{% if tags.electrified and tags.electrified != 'no' %}",
  14. " {% if tags.voltage < 5000 %}",
  15. " {% set color = colorInterpolate([ 'green', 'red' ], tags.voltage / 1000) %}",
  16. " {% else %}",
  17. " {% set color = colorInterpolate([ 'red', 'blue' ], (tags.voltage - 1000) / 24000) %}",
  18. " {% endif %}",
  19. "{% else %}",
  20. " {% set color='black' %}",
  21. "{%endif %}",
  22. "",
  23. "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}",
  24. " {% set weight=2 %}",
  25. " {% else %}",
  26. " {% if tags.railway == 'rail' %}",
  27. " {% if tags.usage == 'main' or tags.usage == 'branch' %}",
  28. " {% set weight=3 %}",
  29. " {% else %}",
  30. " {% set weight=2.5 %}",
  31. " {% endif %}",
  32. " {% else %}",
  33. " {% set weight=2 %}",
  34. " {% endif %}",
  35. "{% endif %}"
  36. ],
  37. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  38. "description": [
  39. "{{ tagTrans('railway', tags.railway) }} -",
  40. "",
  41. "{% if tags.electrified == 'no' %}",
  42. " {{ trans('not electrified') }}",
  43. "{% elseif tags.electrified %}",
  44. " {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
  45. "{% endif %}"
  46. ],
  47. "body": [
  48. "{{ tagTrans('railway', tags.railway) }}<br/>",
  49. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  50. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  51. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  52. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  53. "{% 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 %}"
  54. ],
  55. "markerSign": null,
  56. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  57. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing,highlight{% else %}default,highlight{% endif %}",
  58. "style": {
  59. "weight": "{{ weight }}",
  60. "color": "white",
  61. "opacity": "1",
  62. "fill": null
  63. },
  64. "style:casing": {
  65. "weight": "{{ weight + 2 }}",
  66. "color": "{{ color }}",
  67. "lineCap": "butt",
  68. "dashArray": "2,4"
  69. },
  70. "style:highlight": {
  71. "weight": "{{ weight }}",
  72. "color": "{{ color }}",
  73. "opacity": "1",
  74. "lineCap": "butt",
  75. "dashArray": [
  76. "{% if not tags.electrified or tags.electrified == 'no' %}",
  77. "{% elseif tags.frequency == 0 %}",
  78. "{% else %}",
  79. "5,2",
  80. "{% endif %}"
  81. ],
  82. "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}",
  83. "fillColor": "{% if tags.railway == 'platform' %}#3f3f3f{% endif %}"
  84. }
  85. }
  86. }