{ "type": "overpass", "name": { "de": "Gebäudealter", "en": "Building age", "fr": "Date de construction", "pt-br": "Idade" }, "query": { "16": [ "(", " way[building];", " relation[building];", ")" ] }, "feature": { "pre": [ "{% set start_date = tags.start_date %}", "{% if attribute(tags, 'building:start_date') %}{% set start_date = attribute(tags, 'building:start_date') %}{% endif %}", "{# Deprecated tags #}", "{% if not start_date and attribute(tags, 'building:age') %}{% set start_date = attribute(tags, 'building:age') %}{% endif %}", "{% if not start_date and attribute(tags, 'building:year_built') %}{% set start_date = attribute(tags, 'building:year_built') %}{% endif %}", "{% if not start_date and attribute(tags, 'building:buildyear') %}{% set start_date = attribute(tags, 'building:buildyear') %}{% endif %}", "{% if not start_date and attribute(tags, 'year_built') %}{% set start_date = attribute(tags, 'year_built') %}{% endif %}", "{% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %}", "", "{% if start_date %}", " {% set value = start_date|osmParseDate %}", " {% if value and value[0] and value[1] %}", " {% set value = (value[1] - value[0]) / 2 + value[0] %}", " {% elseif value and value[0] %}", " {% set value = value[0] %}", " {% elseif value and value[1] %}", " {% set value = value[1] %}", " {% else %}", " {% set value = 'error' %}", " {% endif %}", "", " {% if value == 'error' %}", " {% set color = '#ff0000' %}", " {% elseif value < 1500 %}", " {% set color = '#0000ff' %}", " {% elseif value < 1900 %}", " {% set color = colorInterpolate([ '#0000ff', '#ff00ff' ], (value - 1500.0) / 400) %}", " {% elseif value < 2000 %}", " {% set color = colorInterpolate([ '#ff00ff', '#ffff00' ], (value - 1900.0) / 100) %}", " {% else %}", " {% set color = colorInterpolate([ '#ffff00', '#00ff00' ], (value - 2000.0) / 50) %}", " {% endif %}", "{% else %}", "{% set color = '#7f7f7f' %}", "{% endif %}" ], "description": [ "{% if start_date %}", "{{ start_date|osmFormatDate({ format: 'short' }) }}", "{% else %}", "{{ trans('unknown') }}", "{% endif %}" ], "popupDescription": [ "{% if start_date %}", "{{ start_date|osmFormatDate }}", "{% else %}", "{{ trans('unknown') }}", "{% endif %}" ], "markerSymbol": null, "listMarkerSymbol": "{{ markerPolygon({ \"fillColor\": color, \"fillOpacity\": 0.8, \"width\": 1, \"color\": \"#000000\" })|raw }}", "priority": [ "{% set p = 100 %}", "{% if start_date %}{% set p = p - 20 %}{% endif %}", "{% if tags.name %}{% set p = p - 10 %}{% endif %}", "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", "{% if tags.historic %}{% set p = p - 1 %}{% endif %}", "{% if tags.culture %}{% set p = p - 1 %}{% endif %}", "{% if tags.highway %}{% set p = p - 1 %}{% endif %}", "{% if tags.railway %}{% set p = p - 1 %}{% endif %}", "{% if tags.aeroway %}{% set p = p - 1 %}{% endif %}", "{% if tags.amenity %}{% set p = p - 1 %}{% endif %}", "{% if tags.tourism %}{% set p = p - 1 %}{% endif %}", "{{ p }}" ], "style": { "width": "1", "color": "#000000", "fillColor": "{{ color }}", "fillOpacity": "0.8" } }, "info": [ "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1400\" }))|raw }} | ", "<1500 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1500\" }))|raw }} | ", "1500 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1600\" }))|raw }} | ", "1600 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1700\" }))|raw }} | ", "1700 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1800\" }))|raw }} | ", "1800 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1900\" }))|raw }} | ", "1900 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"1950\" }))|raw }} | ", "1950 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2000\" }))|raw }} | ", "2000 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"2020\" }))|raw }} | ", "2020 | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\", \"start_date\": \"xxx\" }))|raw }} | ", "{{ repoTrans('date format not understood') }} | ", "
{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }} | ", "{{ trans('unknown') }} | ", "