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.

104 lines
3.5 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Gebäudehöhen",
  5. "en": "Building height"
  6. },
  7. "query": {
  8. "16": [
  9. "(",
  10. " way[building];",
  11. " relation[building];",
  12. ")"
  13. ]
  14. },
  15. "feature": {
  16. "pre": [
  17. "{% if tags.height %}",
  18. "{% set approxHeight = tags.height %}",
  19. "{% elseif attribute(tags, 'building:levels') %}",
  20. "{% set approxHeight = attribute(tags, 'building:levels') * 3.5 %}",
  21. "{% endif %}",
  22. "",
  23. "{% if approxHeight <= 50 %}",
  24. "{% set color = colorInterpolate(['green', 'red'], approxHeight / 50) %}",
  25. "{% elseif approxHeight %}",
  26. "{% set color = colorInterpolate(['red', 'yellow'], (approxHeight - 50) / 250) %} ",
  27. "{% else %}",
  28. "{% set color = '#7f7f7f' %}",
  29. "{% endif %}"
  30. ],
  31. "description": [
  32. "{% if tags.height %}",
  33. "{{ tags.height }}m",
  34. "{% endif %}",
  35. "",
  36. "{% if attribute(tags, 'building:levels') %}",
  37. "{{ attribute(tags, 'building:levels') }} {{ keyTrans('building:levels') }}",
  38. "{% endif %}"
  39. ],
  40. "markerSymbol": null,
  41. "listMarkerSymbol": "{{ markerCircle({fillColor: color})|raw }}",
  42. "priority": "{{ (approxHeight|default(0)) * -1 }}",
  43. "style": {
  44. "width": "1",
  45. "color": "#000000",
  46. "fillColor": "{{ color }}",
  47. "fillOpacity": "1"
  48. }
  49. },
  50. "info": [
  51. "<div style='display: inline-block'>",
  52. "{{ tagTrans('height') }}",
  53. "<table>",
  54. " <tr>",
  55. " <td>{{ markerCircle({ 'fillColor': '#7f7f7f' })|raw }}</td>",
  56. " <td colspan>{{ trans('unknown') }}</td>",
  57. " </tr>",
  58. "{% for i in range(0, 50, 10) %}",
  59. " <tr>",
  60. " <td>{{ markerCircle({ 'fillColor': colorInterpolate(['green', 'red'], i / 50) })|raw }}</td>",
  61. " <td>{{ i }}m</td>",
  62. " </tr>",
  63. "{% endfor %}",
  64. "{% for i in range(100, 250, 50) %}",
  65. " <tr>",
  66. " <td>{{ markerCircle({ 'fillColor': colorInterpolate(['red', 'yellow'], (i - 50) / 250) })|raw }}</td>",
  67. " <td>{{ i }}m</td>",
  68. " </tr>",
  69. "{% endfor %}",
  70. " <tr>",
  71. " <td>{{ markerCircle({ 'fillColor': 'yellow' })|raw }}</td>",
  72. " <td>≥300m</td>",
  73. " </tr>",
  74. "</table>",
  75. "</div>",
  76. "",
  77. "<div style='display: inline-block'>",
  78. "{{ tagTrans('building:levels') }}",
  79. "<table>",
  80. " <tr>",
  81. " <td>{{ markerCircle({ 'fillColor': '#7f7f7f' })|raw }}</td>",
  82. " <td colspan>{{ trans('unknown') }}</td>",
  83. " </tr>",
  84. "{% for i in range(0, 12, 3) %}",
  85. " <tr>",
  86. " <td>{{ markerCircle({ 'fillColor': colorInterpolate(['green', 'red'], (i * 3.5) / 50) })|raw }}</td>",
  87. " <td>{{ i }}</td>",
  88. " </tr>",
  89. "{% endfor %}",
  90. "{% for i in range(15, 84, 15) %}",
  91. " <tr>",
  92. " <td>{{ markerCircle({ 'fillColor': colorInterpolate(['red', 'yellow'], (i * 3.5 - 50) / 250) })|raw }}</td>",
  93. " <td>{{ i }}</td>",
  94. " </tr>",
  95. "{% endfor %}",
  96. " <tr>",
  97. " <td>{{ markerCircle({ 'fillColor': 'yellow' })|raw }}</td>",
  98. " <td>≥85</td>",
  99. " </tr>",
  100. "</table>",
  101. "",
  102. "</div>"
  103. ]
  104. }