From d194b16814f34c4450e124cb18d67281e7e2e387 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Mon, 1 Jun 2020 23:05:15 +0200
Subject: [PATCH] Construction: add proposals and developable_areas

---
 planning.json => developable_areas.json |  4 +--
 index.json                              |  5 ++-
 proposals.json                          | 45 +++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 3 deletions(-)
 rename planning.json => developable_areas.json (76%)
 create mode 100644 proposals.json

diff --git a/planning.json b/developable_areas.json
similarity index 76%
rename from planning.json
rename to developable_areas.json
index 8e961e1..8f67600 100644
--- a/planning.json
+++ b/developable_areas.json
@@ -1,7 +1,7 @@
 {
     "type": "overpass",
     "name": {
-        "en": "Planning",
+        "en": "Developable Areas"
     },
     "query": {
         "13": [
@@ -15,6 +15,6 @@
             "{% set key = 'landuse' %}",
             "{% set value = tags.landuse %}"
         ],
-        "description": "{{ tagTrans(key, value) }} {{ key}} {{ value }}"
+        "description": "{{ tagTrans(key, value) }}"
     }
 }
diff --git a/index.json b/index.json
index 53e4b8a..e2c2824 100644
--- a/index.json
+++ b/index.json
@@ -276,7 +276,10 @@
                             "id": "construction"
                         },
                         {
-                            "id": "planning"
+                            "id": "proposals"
+                        },
+                        {
+                            "id": "developable_areas"
                         }
                     ]
                 },
diff --git a/proposals.json b/proposals.json
new file mode 100644
index 0000000..a5d0517
--- /dev/null
+++ b/proposals.json
@@ -0,0 +1,45 @@
+{
+    "type": "overpass",
+    "name": {
+        "en": "Proposals"
+    },
+    "query": {
+        "13": [
+            "(",
+            "nwr[landuse~\"^(proposed)$\"];",
+            "nwr[highway~\"^(proposed)$\"];",
+            "nwr[railway~\"^(proposed)$\"];",
+            "nwr[building~\"^(proposed)$\"];",
+            "nwr[highway~\"^(proposed)$\"];",
+            "nwr[~\"^proposed:\"~\".\"];",
+            ")"
+        ]
+    },
+    "feature": {
+        "pre": [
+            "{% set key = null %}{% set value = null %}",
+            "{% if tags.highway == 'proposed' %}",
+            "{% set key = 'highway' %}",
+            "{% set value = tags.proposed|default('construction') %}",
+            "{% elseif tags.railway == 'proposed' %}",
+            "{% set key = 'railway' %}",
+            "{% set value = tags.proposed|default('construction') %}",
+            "{% elseif tags.building == 'proposed' %}",
+            "{% set key = 'building' %}",
+            "{% set value = tags.proposed|default('construction') %}",
+            "{% elseif tags.landuse == 'proposed' %}",
+            "{% set key = 'landuse' %}",
+            "{% set value = tags.proposed|default('construction') %}",
+            "{% else %}",
+            "{% for k, v in tags %}",
+            "{% set m = k|matches('^proposed:(.*)$') %}",
+            "{% if m %}",
+            "{% set key = m[1] %}",
+            "{% set value = v %}",
+            "{{ debug(key, value) }}",
+            "{% endif %}{% endfor %}",
+            "{% endif %}"
+        ],
+        "description": "{{ tagTrans(key, value) }}"
+    }
+}