Main categories of OpenStreetBrowser with support for whitewater
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.

77 lines
3.7 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Railway gauge"
  5. },
  6. "query": {
  7. "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];",
  8. "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'];"
  9. },
  10. "feature": {
  11. "pre": "{% set gauges = tags.gauge|split(';') %}",
  12. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  13. "description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}",
  14. "body": [
  15. "{{ tagTrans('railway', tags.railway) }}<br/>",
  16. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  17. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  18. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  19. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown'))|enumerate }}<br/>",
  20. "{% 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 %}"
  21. ],
  22. "markerSymbol": null,
  23. "listMarkerSymbol": "line",
  24. "styles": "{% if gauges|length < 2 %}default{% else %}{% for i, v in gauges %}{% if i != 0 %},{% endif %}gauge{{ i }}{% endfor %}{% endif %}",
  25. "style": {
  26. "width": "3",
  27. "color": "{% if tags.gauge %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[0] / 2000) }}{% else %}#404040{% endif %}"
  28. },
  29. "style:gauge0": {
  30. "width": "3",
  31. "lineCap": "butt",
  32. "color": "{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[0] / 2000) }}",
  33. "dashArray": "5,{{ (gauges|length - 1) * 5 }}"
  34. },
  35. "style:gauge1": {
  36. "width": "3",
  37. "lineCap": "butt",
  38. "color": "{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[1] / 2000) }}",
  39. "dashArray": "5,{{ (gauges|length - 1) * 5 }}",
  40. "dashOffset": "5"
  41. },
  42. "style:gauge2": {
  43. "width": "3",
  44. "lineCap": "butt",
  45. "color": "{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[2] / 2000) }}",
  46. "dashArray": "5,{{ (gauges|length - 1) * 5 }}",
  47. "dashOffset": "10"
  48. },
  49. "style:gauge3": {
  50. "width": "3",
  51. "lineCap": "butt",
  52. "color": "{{ colorInterpolate([ '#00ff00', '#0000ff' ], gauges[3] / 2000) }}",
  53. "dashArray": "5,{{ (gauges|length - 1) * 5 }}",
  54. "dashOffset": "15"
  55. }
  56. },
  57. "info": [
  58. "<table>",
  59. " {% set color = '#404040' %}",
  60. " <tr>",
  61. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  62. " <td>{{ trans('unknown') }}</td>",
  63. " </tr>",
  64. "{% for i in range(0, 1800, 250) %}",
  65. " {% set color = colorInterpolate([ '#00ff00', '#0000ff' ], i / 2000) %}",
  66. " <tr>",
  67. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  68. " <td>{{ i }}mm</td>",
  69. " </tr>",
  70. "{% endfor %}",
  71. " <tr>",
  72. " <td>{{ markerLine({ 'width': 3, 'color': '#0000ff' })|raw }}</td>",
  73. " <td>>2000mm</td>",
  74. " </tr>",
  75. "</table>"
  76. ]
  77. }