From c4bbd7d5577d01be0c328fa615c06836c1a64ca5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sun, 31 May 2020 07:41:05 +0200
Subject: [PATCH] construction: include railway, building, construction:*=*

---
 construction.json | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/construction.json b/construction.json
index 617eee2..1243ca1 100644
--- a/construction.json
+++ b/construction.json
@@ -19,20 +19,36 @@
             "(",
             "nwr[landuse~\"^(construction)$\"];",
             "nwr[highway~\"^(construction)$\"];",
+            "nwr[railway~\"^(construction)$\"];",
+            "nwr[building~\"^(construction)$\"];",
+            "nwr[highway~\"^(construction)$\"];",
+            "nwr[~\"^construction:\"~\".\"];",
             ")"
         ]
     },
     "feature": {
         "pre": [
+            "{% set key = null %}{% set value = null %}",
             "{% if tags.highway == 'construction' %}",
             "{% set key = 'highway' %}",
-            "{% set value = tags.construction %}",
-            "{% elseif tags.landuse == 'construction' and tags.construction %}",
+            "{% set value = tags.construction|default('construction') %}",
+            "{% elseif tags.railway == 'construction' %}",
+            "{% set key = 'railway' %}",
+            "{% set value = tags.construction|default('construction') %}",
+            "{% elseif tags.building == 'construction' %}",
+            "{% set key = 'building' %}",
+            "{% set value = tags.construction|default('construction') %}",
+            "{% elseif tags.landuse == 'construction' %}",
             "{% set key = 'landuse' %}",
-            "{% set value = tags.construction %}",
+            "{% set value = tags.construction|default('construction') %}",
             "{% else %}",
-            "{% set key = 'landuse' %}",
-            "{% set value = tags.landuse %}",
+            "{% for k, v in tags %}",
+            "{% set m = k|matches('^construction:(.*)$') %}",
+            "{% if m %}",
+            "{% set key = m[1] %}",
+            "{% set value = v %}",
+            "{{ debug(key, value) }}",
+            "{% endif %}{% endfor %}",
             "{% endif %}"
         ],
         "description": "{{ tagTrans(key, value) }}"