From 176312b461692c23019a520058f065c4652420f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 17 Feb 2019 18:57:49 +0100 Subject: [PATCH] buildings-start_date: equals some common tagging mistakes - 1910-1911 -> 1910..1911 - 191* -> 1910s --- buildings-start_date.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildings-start_date.json b/buildings-start_date.json index fad9b959..326f0b5e 100644 --- a/buildings-start_date.json +++ b/buildings-start_date.json @@ -26,6 +26,11 @@ "{% if not start_date and attribute(tags, 'building:year') %}{% set start_date = attribute(tags, 'building:year') %}{% endif %}", "", "{% if start_date %}", + " {# equalize tagging mistakes - need to add QA messages #}", + " {# 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 %}", + " {# convert 191* to 1910s #}{% set m = start_date|matches('^(\\d{3})\\*$') %}{% if m %}{% set start_date = m[1] ~ '0s' %}{% endif %}", + "", + "", " {% set value = start_date|osmParseDate %}", " {% if value and value[0] and value[1] %}", " {% set value = (value[1] - value[0]) / 2 + value[0] %}",