A repository for testing purposes.
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.

130 lines
4.9 KiB

4 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Lanes"
  5. },
  6. "query": {
  7. "17": "way[lanes];"
  8. },
  9. "feature": {
  10. "pre": [
  11. "{% set parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lang:both')) %}",
  12. "{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lang:both')) %}",
  13. "{% set lanes_width = tags.lanes * 3 %}"
  14. ],
  15. "description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}",
  16. "body": [
  17. "{{ tagTrans('railway', tags.railway) }}<br/>",
  18. "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
  19. "{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
  20. "{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
  21. "{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown'))|enumerate }}<br/>",
  22. "{% 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 %}"
  23. ],
  24. "markerSymbol": null,
  25. "listMarkerSymbol": "line",
  26. "styles": "{% if parking_left %}parking_left,{% endif %}lanes{% for i in 1..tags.lanes - 1 %},mark{{ i }}{% endfor %}",
  27. "style": {
  28. "width": "{{ width }}",
  29. "pane": "casing",
  30. "color": "{% if tags.gauge %}{% if not tags.gauge|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], tags.gauge / 2000) }}{% endif %}{% else %}#404040{% endif %}"
  31. },
  32. "style:parking_left": {
  33. "width": "2m",
  34. "color": "orange",
  35. "offset": "{{ lanes_width / -2 - 1 }}m",
  36. "text": "foobar"
  37. },
  38. "style:lanes": {
  39. "width": "{{ lanes_width }}m",
  40. "color": "grey",
  41. "pane": "casing"
  42. },
  43. "style:mark1": {
  44. "width": "1",
  45. "offset": "{{ lanes_width / -2 + 3 }}m",
  46. "color": "white"
  47. },
  48. "style:mark2": {
  49. "width": "1",
  50. "offset": "{{ lanes_width / -2 + 6 }}m",
  51. "color": "white"
  52. },
  53. "style:mark3": {
  54. "width": "1",
  55. "offset": "{{ lanes_width / -2 + 9 }}m",
  56. "color": "white"
  57. },
  58. "style:mark4": {
  59. "width": "1",
  60. "offset": "{{ lanes_width / -2 + 12 }}m",
  61. "color": "white"
  62. },
  63. "style:mark5": {
  64. "width": "1",
  65. "offset": "{{ lanes_width / -2 + 15 }}m",
  66. "color": "white"
  67. },
  68. "style:mark6": {
  69. "width": "1",
  70. "offset": "{{ lanes_width / -2 + 18 }}m",
  71. "color": "white"
  72. },
  73. "style:mark7": {
  74. "width": "1",
  75. "offset": "{{ lanes_width / -2 + 18 }}m",
  76. "color": "white"
  77. },
  78. "style:mark8": {
  79. "width": "1",
  80. "offset": "{{ lanes_width / -2 + 18 }}m",
  81. "color": "white"
  82. },
  83. "style:mark9": {
  84. "width": "1",
  85. "offset": "{{ lanes_width / -2 + 18 }}m",
  86. "color": "white"
  87. },
  88. "style:mark10": {
  89. "width": "1",
  90. "offset": "{{ lanes_width / -2 + 18 }}m",
  91. "color": "white"
  92. },
  93. "style:mark11": {
  94. "width": "1",
  95. "offset": "{{ lanes_width / -2 + 18 }}m",
  96. "color": "white"
  97. },
  98. "style:mark12": {
  99. "width": "1",
  100. "offset": "{{ lanes_width / -2 + 18 }}m",
  101. "color": "white"
  102. }
  103. },
  104. "info": [
  105. "{{ map.metersPerPixel }}",
  106. "<table>",
  107. " {% set color = '#ff0000' %}",
  108. " <tr>",
  109. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  110. " <td>{{ trans('illegal value') }}</td>",
  111. " </tr>",
  112. " {% set color = '#404040' %}",
  113. " <tr>",
  114. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  115. " <td>{{ trans('unknown') }}</td>",
  116. " </tr>",
  117. "{% for i in range(0, 1800, 250) %}",
  118. " {% set color = colorInterpolate([ '#00ff00', '#0000ff' ], i / 2000) %}",
  119. " <tr>",
  120. " <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
  121. " <td>{{ i }}mm</td>",
  122. " </tr>",
  123. "{% endfor %}",
  124. " <tr>",
  125. " <td>{{ markerLine({ 'width': 3, 'color': '#0000ff' })|raw }}</td>",
  126. " <td>>2000mm</td>",
  127. " </tr>",
  128. "</table>"
  129. ]
  130. }