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.

168 lines
6.2 KiB

  1. name:
  2. ca: Antiguitat de l'edifici
  3. cs: Stáří budovy
  4. de: Gebäudealter
  5. en: Building age
  6. es: Edad del edificio
  7. fr: Date de construction
  8. gl: Idade do edificio
  9. hu: Épületek kora
  10. it: Età dell'edificio
  11. ja: 築年数
  12. nb: Bygningsalder
  13. nl: Ouderdom van het gebouw
  14. oc: Data de bastison
  15. pl: Wiek budynków
  16. pt-br: Idade
  17. pt: Idade dos edifícios
  18. ro: Vârsta clădirii
  19. ru: Возраст здания
  20. sr: Старост зграде
  21. tr: Bina yaşı
  22. query:
  23. 16: |-
  24. (
  25. way[building];
  26. relation[building];
  27. )
  28. feature:
  29. pre: |-
  30. {% set type = tags.building|split(';')[0] %}
  31. {% if tags.military %}{% set type = 'military' %}{% endif %}
  32. {% set start_date = tags.start_date %}
  33. {% if attribute(tags, 'building:start_date') %}{% set start_date = attribute(tags, 'building:start_date') %}{% endif %}
  34. {# Deprecated tags #}
  35. {% if not start_date and attribute(tags, 'building:age') %}{% set start_date = attribute(tags, 'building:age') %}{% endif %}
  36. {% if not start_date and attribute(tags, 'building:year_built') %}{% set start_date = attribute(tags, 'building:year_built') %}{% endif %}
  37. {% if not start_date and attribute(tags, 'building:buildyear') %}{% set start_date = attribute(tags, 'building:buildyear') %}{% endif %}
  38. {% if not start_date and attribute(tags, 'year_built') %}{% set start_date = attribute(tags, 'year_built') %}{% endif %}
  39. {% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %}
  40. {% if not start_date and attribute(tags, 'year_of_construction') %}{% set start_date = attribute(tags, 'year_of_construction') %}{% endif %}
  41. {% if start_date %}
  42. {# equalize tagging mistakes - need to add QA messages #}
  43. {# convert 1910-1911 to 1910..1911 #}{% set m = start_date|matches('^(\d{4})-(\d{4})$') %}{% if m %}{% set start_date = m[1] ~ '..' ~ m[2] %}{% endif %}
  44. {# convert 191* to 1910s #}{% set m = start_date|matches('^(\d{3})\*$') %}{% if m %}{% set start_date = m[1] ~ '0s' %}{% endif %}
  45. {% set value = start_date|osmParseDate %}
  46. {% if value and value[0] and value[1] %}
  47. {% set value = (value[1] - value[0]) / 2 + value[0] %}
  48. {% elseif value and value[0] %}
  49. {% set value = value[0] %}
  50. {% elseif value and value[1] %}
  51. {% set value = value[1] %}
  52. {% else %}
  53. {% set value = 'error' %}
  54. {% endif %}
  55. {% if value == 'error' %}
  56. {% set color = '#ff0000' %}
  57. {% elseif value < 1500 %}
  58. {% set color = '#0000ff' %}
  59. {% elseif value < 1900 %}
  60. {% set color = colorInterpolate([ '#0000ff', '#ff00ff' ], (value - 1500.0) / 400) %}
  61. {% elseif value < 2000 %}
  62. {% set color = colorInterpolate([ '#ff00ff', '#ffff00' ], (value - 1900.0) / 100) %}
  63. {% else %}
  64. {% set color = colorInterpolate([ '#ffff00', '#00ff00' ], (value - 2000.0) / 50) %}
  65. {% endif %}
  66. {% else %}
  67. {% set color = '#7f7f7f' %}
  68. {% endif %}
  69. description: |-
  70. {% if tags.building == 'yes' and tags.military %}
  71. {{ tagTrans('building', 'military') }}
  72. {% elseif tags.building == 'yes' %}
  73. {{ keyTrans('building') }}
  74. {% else %}
  75. {{ tagTransList('building', tags.building) }}
  76. {% endif %}
  77. {% if tags.building == 'construction' and tags.construction %}
  78. ({{ tagTransList('building', tags.construction) }})
  79. {% endif %}
  80. {% if tags.building in [ 'yes', 'military' ] and tags.military %}
  81. ({{ tagTransList('military', tags.military) }})
  82. {% endif %}
  83. details: |-
  84. {% if start_date %}
  85. {{ start_date|osmFormatDate({ format: 'short' }) }}
  86. {% else %}
  87. {{ trans('unknown') }}
  88. {% endif %}
  89. body: |-
  90. <ul>
  91. {% if attribute(tags, 'building:start_date') %}<li>
  92. <span class='key'>{{ keyTrans('building:start_date') }}:</span>
  93. <span class='value'>{{ attribute(tags, 'building:start_date')|osmFormatDate }}</span>
  94. </li>{% endif %}
  95. </ul>
  96. markerSymbol: null
  97. listMarkerSymbol: |-
  98. {{ markerPolygon({ "fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }}
  99. priority: |-
  100. {% set p = 100 %}
  101. {% if start_date %}{% set p = p - 20 %}{% endif %}
  102. {% if tags.name %}{% set p = p - 10 %}{% endif %}
  103. {% if tags.amenity %}{% set p = p - 1 %}{% endif %}
  104. {% if tags.historic %}{% set p = p - 1 %}{% endif %}
  105. {% if tags.culture %}{% set p = p - 1 %}{% endif %}
  106. {% if tags.highway %}{% set p = p - 1 %}{% endif %}
  107. {% if tags.railway %}{% set p = p - 1 %}{% endif %}
  108. {% if tags.aeroway %}{% set p = p - 1 %}{% endif %}
  109. {% if tags.amenity %}{% set p = p - 1 %}{% endif %}
  110. {% if tags.tourism %}{% set p = p - 1 %}{% endif %}
  111. {{ p }}
  112. style:
  113. width: 1
  114. color: '#000000'
  115. fillColor: '{{ color }}'
  116. fillOpacity: 0.8
  117. info: |-
  118. <table>
  119. <tr>
  120. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1400" }))|raw }}</td>
  121. <td>&lt;1500</td>
  122. </tr>
  123. <tr>
  124. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1500" }))|raw }}</td>
  125. <td>1500</td>
  126. </tr>
  127. <tr>
  128. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1600" }))|raw }}</td>
  129. <td>1600</td>
  130. </tr>
  131. <tr>
  132. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1700" }))|raw }}</td>
  133. <td>1700</td>
  134. </tr>
  135. <tr>
  136. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1800" }))|raw }}</td>
  137. <td>1800</td>
  138. </tr>
  139. <tr>
  140. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1900" }))|raw }}</td>
  141. <td>1900</td>
  142. </tr>
  143. <tr>
  144. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "1950" }))|raw }}</td>
  145. <td>1950</td>
  146. </tr>
  147. <tr>
  148. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "2000" }))|raw }}</td>
  149. <td>2000</td>
  150. </tr>
  151. <tr>
  152. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "2020" }))|raw }}</td>
  153. <td>2020</td>
  154. </tr>
  155. <tr>
  156. <td>{{ markerPolygon(evaluate({ "building": "yes", "start_date": "xxx" }))|raw }}</td>
  157. <td>{{ repoTrans('date format not understood') }}</td>
  158. </tr>
  159. <tr>
  160. <td>{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}</td>
  161. <td>{{ trans('unknown') }}</td>
  162. </tr>
  163. </table>