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.

120 lines
4.7 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Building age",
  5. "de": "Gebäudealter"
  6. },
  7. "query": {
  8. "16": [
  9. "(",
  10. " way[building];",
  11. " relation[building];",
  12. ")"
  13. ]
  14. },
  15. "feature": {
  16. "pre": [
  17. "{% if tags.start_date %}",
  18. " {% set value = tags.start_date|osmParseDate %}",
  19. " {% if value and value[0] and value[1] %}",
  20. " {% set value = (value[1] - value[0]) / 2 + value[0] %}",
  21. " {% elseif value and value[0] %}",
  22. " {% set value = value[0] %}",
  23. " {% elseif value and value[1] %}",
  24. " {% set value = value[1] %}",
  25. " {% else %}",
  26. " {% set value = 'error' %}",
  27. " {% endif %}",
  28. "",
  29. " {% if value == 'error' %}",
  30. " {% set color = '#ff0000' %}",
  31. " {% elseif value < 1500 %}",
  32. " {% set color = '#0000ff' %}",
  33. " {% elseif value < 1900 %}",
  34. " {% set color = colorInterpolate([ '#0000ff', '#ff00ff' ], (value - 1500.0) / 400) %}",
  35. " {% elseif value < 2000 %}",
  36. " {% set color = colorInterpolate([ '#ff00ff', '#ffff00' ], (value - 1900.0) / 100) %}",
  37. " {% else %}",
  38. " {% set color = colorInterpolate([ '#ffff00', '#00ff00' ], (value - 2000.0) / 50) %}",
  39. " {% endif %}",
  40. "{% else %}",
  41. "{% set color = '#7f7f7f' %}",
  42. "{% endif %}"
  43. ],
  44. "description": [
  45. "{% if tags.start_date %}",
  46. "{{ tags.start_date }}",
  47. "{% endif %}"
  48. ],
  49. "markerSymbol": null,
  50. "listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}",
  51. "priority": [
  52. "{% set p = 100 %}",
  53. "{% if tags.start_date %}{% set p = p - 20 %}{% endif %}",
  54. "{% if tags.name %}{% set p = p - 10 %}{% endif %}",
  55. "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}",
  56. "{% if tags.historic %}{% set p = p - 1 %}{% endif %}",
  57. "{% if tags.culture %}{% set p = p - 1 %}{% endif %}",
  58. "{% if tags.highway %}{% set p = p - 1 %}{% endif %}",
  59. "{% if tags.railway %}{% set p = p - 1 %}{% endif %}",
  60. "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}",
  61. "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}",
  62. "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}",
  63. "{{ p }}"
  64. ],
  65. "style": {
  66. "width": "1",
  67. "color": "#000000",
  68. "fillColor": "{{ color }}",
  69. "fillOpacity": "0.8"
  70. }
  71. },
  72. "info": [
  73. "<table>",
  74. " <tr>",
  75. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1400\" }))|raw }}</td>",
  76. " <td>&lt;1500</td>",
  77. " </tr>",
  78. " <tr>",
  79. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1500\" }))|raw }}</td>",
  80. " <td>1500</td>",
  81. " </tr>",
  82. " <tr>",
  83. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1600\" }))|raw }}</td>",
  84. " <td>1600</td>",
  85. " </tr>",
  86. " <tr>",
  87. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1700\" }))|raw }}</td>",
  88. " <td>1700</td>",
  89. " </tr>",
  90. " <tr>",
  91. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1800\" }))|raw }}</td>",
  92. " <td>1800</td>",
  93. " </tr>",
  94. " <tr>",
  95. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1900\" }))|raw }}</td>",
  96. " <td>1900</td>",
  97. " </tr>",
  98. " <tr>",
  99. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1950\" }))|raw }}</td>",
  100. " <td>1950</td>",
  101. " </tr>",
  102. " <tr>",
  103. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2000\" }))|raw }}</td>",
  104. " <td>2000</td>",
  105. " </tr>",
  106. " <tr>",
  107. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2020\" }))|raw }}</td>",
  108. " <td>2020</td>",
  109. " </tr>",
  110. " <tr>",
  111. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"xxx\" }))|raw }}</td>",
  112. " <td>unparseable start_date</td>",
  113. " </tr>",
  114. " <tr>",
  115. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}</td>",
  116. " <td>no start_date</td>",
  117. " </tr>",
  118. "</table>"
  119. ]
  120. }