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.

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