Main categories of OpenStreetBrowser
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.

134 lines
5.3 KiB

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