From 7b73138f24c04f79d2602dc7b3c68db42f519b5f Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Thu, 6 Oct 2022 15:06:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20import=20button=20-=20Impor?= =?UTF-8?q?t=20button=20will=20show=20when=20the=20object=20isn't=20in=20o?= =?UTF-8?q?sm=20-=20A=20conflate=20button=20to=20update=20data=20in=20osm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index aafd3927a3..101ea2bee9 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -98,7 +98,11 @@ "_overlap_percentage=Math.round(100 * (feat.get('_overlaps_with')?.overlap / feat.get('_overlaps_with_properties')['_surface:strict']))", "_reverse_overlap_percentage=Math.round(100 * (feat.get('_overlaps_with')?.overlap / feat.get('_surface')))", - "_bag_obj:building=(feat.properties.status.startsWith('Bouwvergunning verleend') || feat.properties.status.startsWith('Bouw gestart')) ? 'construction' : ((feat.properties.status.startsWith('Pand in gebruik') && feat.properties.gebruiksdoel == 'woonfunctie') ? ((Number(feat.properties.aantal_verblijfsobjecten) == 1) ? 'house' : 'apartments') : 'yes')", + "_bag_obj:in_construction=feat.properties.status.startsWith('Bouwvergunning verleend') || feat.properties.status.startsWith('Bouw gestart')", + "_bag_obj:construction=(feat.properties.gebruiksdoel == 'woonfunctie') ? ((Number(feat.properties.aantal_verblijfsobjecten) == 1) ? 'house' : 'apartments') : 'yes'", + "_bag_obj:building=(feat.properties.status.startsWith('Bouwvergunning verleend') || feat.properties.status.startsWith('Bouw gestart')) ? 'construction' : feat.properties['_bag_obj:construction']", + "_bag_obj:ref:bag=Number(feat.properties.identificatie)", + "_bag_obj:source:date=new Date().toISOString().split('T')[0]", "_bag_obj:start_date=feat.properties.bouwjaar", "_osm_obj:id=feat.get('_overlaps_with_properties')?.id", @@ -129,6 +133,26 @@ } ], "tagRenderings": [ + { + "id": "Import button", + "render": "{import_way_button(osm:buildings, building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date, Upload this building to OpenStreetMap)}", + "mappings": [ + { + "if": "_bag_obj:in_construction=true", + "then": "{import_way_button(osm:buildings, building=$_bag_obj:building; construction=$_bag_obj:construction; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date, Upload this building to OpenStreetMap)}" + }, + { + "if": { + "and": [ + "_overlap_percentage>50", + "_reverse_overlap_percentage>50", + "_overlaps_with!=" + ] + }, + "then": "{conflate_button(osm:buildings, building=$_bag_obj:building; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date; start_date=$_bag_obj:start_date, Replace the geometry in OpenStreetMap, , _osm_obj:id)}" + } + ] + }, { "id": "Build year", "render": {