Main categories of OpenStreetBrowser with support for whitewater
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.

121 lines
4.7 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 }}",
  48. "{% endif %}"
  49. ],
  50. "markerSymbol": null,
  51. "listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}",
  52. "priority": [
  53. "{% set p = 100 %}",
  54. "{% if tags.start_date %}{% set p = p - 20 %}{% endif %}",
  55. "{% if tags.name %}{% set p = p - 10 %}{% endif %}",
  56. "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}",
  57. "{% if tags.historic %}{% set p = p - 1 %}{% endif %}",
  58. "{% if tags.culture %}{% set p = p - 1 %}{% endif %}",
  59. "{% if tags.highway %}{% set p = p - 1 %}{% endif %}",
  60. "{% if tags.railway %}{% set p = p - 1 %}{% endif %}",
  61. "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}",
  62. "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}",
  63. "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}",
  64. "{{ p }}"
  65. ],
  66. "style": {
  67. "width": "1",
  68. "color": "#000000",
  69. "fillColor": "{{ color }}",
  70. "fillOpacity": "0.8"
  71. }
  72. },
  73. "info": [
  74. "<table>",
  75. " <tr>",
  76. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1400\" }))|raw }}</td>",
  77. " <td>&lt;1500</td>",
  78. " </tr>",
  79. " <tr>",
  80. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1500\" }))|raw }}</td>",
  81. " <td>1500</td>",
  82. " </tr>",
  83. " <tr>",
  84. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1600\" }))|raw }}</td>",
  85. " <td>1600</td>",
  86. " </tr>",
  87. " <tr>",
  88. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1700\" }))|raw }}</td>",
  89. " <td>1700</td>",
  90. " </tr>",
  91. " <tr>",
  92. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1800\" }))|raw }}</td>",
  93. " <td>1800</td>",
  94. " </tr>",
  95. " <tr>",
  96. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1900\" }))|raw }}</td>",
  97. " <td>1900</td>",
  98. " </tr>",
  99. " <tr>",
  100. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1950\" }))|raw }}</td>",
  101. " <td>1950</td>",
  102. " </tr>",
  103. " <tr>",
  104. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2000\" }))|raw }}</td>",
  105. " <td>2000</td>",
  106. " </tr>",
  107. " <tr>",
  108. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2020\" }))|raw }}</td>",
  109. " <td>2020</td>",
  110. " </tr>",
  111. " <tr>",
  112. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"xxx\" }))|raw }}</td>",
  113. " <td>unparseable start_date</td>",
  114. " </tr>",
  115. " <tr>",
  116. " <td>{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }}</td>",
  117. " <td>no start_date</td>",
  118. " </tr>",
  119. "</table>"
  120. ]
  121. }