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.

130 lines
5.0 KiB

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