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.

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