Main categories of OpenStreetBrowser with public transport zoom level
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. "style:casing": {
  38. "weight": "{{ weight + 2 }}",
  39. "color": "{{ color }}",
  40. "dashArray": "2,4",
  41. "lineCap": "butt"
  42. },
  43. "style": {
  44. "color": "white",
  45. "weight": "{{ weight }}",
  46. "fill": null,
  47. "opacity": "1"
  48. },
  49. "style:highlight": {
  50. "color": "{{ color }}",
  51. "weight": "{{ weight }}",
  52. "dashArray": [
  53. "{% if not tags.electrified or tags.electrified == 'no' %}",
  54. "{% elseif tags.frequency == 0 %}",
  55. "{% else %}",
  56. "5,2",
  57. "{% endif %}"
  58. ],
  59. "fillColor": "{% if tags.railway == 'platform' %}#3f3f3f{% endif %}",
  60. "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}",
  61. "opacity": "1",
  62. "lineCap": "butt"
  63. },
  64. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing,highlight{% else %}default,highlight{% endif %}",
  65. "markerSign": null,
  66. "body": [
  67. "{{ tagTrans('railway', tags.railway) }}<br/>",
  68. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  69. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  70. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  71. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>",
  72. "{% 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 %}"
  73. ],
  74. "description": [
  75. "{{ tagTrans('railway', tags.railway) }} -",
  76. "",
  77. "{% if tags.electrified == 'no' %}",
  78. " {{ trans('not electrified') }}",
  79. "{% elseif tags.electrified %}",
  80. " {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz",
  81. "{% endif %}"
  82. ],
  83. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  84. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}"
  85. }
  86. }