diff --git a/buildings-start_date.json b/buildings-start_date.json new file mode 100644 index 00000000..04a0d67f --- /dev/null +++ b/buildings-start_date.json @@ -0,0 +1,120 @@ +{ + "type": "overpass", + "name": { + "en": "Buildings", + "de": "Gebäude" + }, + "query": { + "16": [ + "(", + " way[building];", + " relation[building];", + ")" + ] + }, + "feature": { + "pre": [ + "{% if tags.start_date %}", + " {% set value = tags.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 = '#000000' %}", + "{% endif %}" + ], + "description": [ + "{% if tags.start_date %}", + "{{ tags.start_date }}", + "{% endif %}" + ], + "markerSign": null, + "listMarkerSymbol": "polygon", + "priority": [ + "{% set p = 100 %}", + "{% if tags.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": { + "weight": "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 }} | ", + "unparseable start_date | ", + "
{{ markerPolygon(evaluate({ \"building\": \"yes\" }))|raw }} | ", + "no start_date | ", + "