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.

105 lines
3.7 KiB

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