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.

127 lines
4.8 KiB

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