From db7853f03232f3870fdf2b6dca30d738c6ecfbeb Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Tue, 12 Jul 2022 23:48:22 +0200 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=9A=A7=20Basic=20building=20and=20a?= =?UTF-8?q?dress=20rendering=20working?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 81 +++++++++++++++++++ assets/themes/bag_import/license_info.json | 10 +++ assets/themes/bag_import/logo.svg | 5 ++ .../mapcomplete-changes.json | 4 + langs/themes/nl.json | 5 ++ 5 files changed, 105 insertions(+) create mode 100644 assets/themes/bag_import/bag.json create mode 100644 assets/themes/bag_import/license_info.json create mode 100644 assets/themes/bag_import/logo.svg diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json new file mode 100644 index 0000000000..2a25093d42 --- /dev/null +++ b/assets/themes/bag_import/bag.json @@ -0,0 +1,81 @@ +{ + "id": "bag", + "title": { + "nl": "BAG import helper" + }, + "shortDescription": { + "nl": "BAG import helper tool" + }, + "description": { + "nl": "Dit thema helpt het importeren van BAG data" + }, + "maintainer": "Wouter van der Wal", + "icon": "./assets/themes/bag_import/logo.svg", + "version": "0", + "startLat": 53.1726, + "startLon": 7.04545, + "startZoom": 9, + "overrideAll": { + "minzoom": 19 + }, + "layers": [ + { + "id": "bag:pand", + "description": "Buildings which come from the BAG", + "source": { + "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", + "geoJsonZoomLevel": 18, + "osmTags": { + "and": [ + "building~*" + ] + }, + "maxCacheAge": 0 + }, + "mapRendering": [ + { + "width": { + "render": 5 + }, + "color": { + "render": "#00a" + } + } + ] + }, + { + "id": "bag:verblijfsobject", + "source": { + "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", + "geoJsonZoomLevel": 18, + "osmTags": { + "and": [ + "building~*" + ] + }, + "maxCacheAge": 0 + }, + "calculatedTags": [ + "addr:housenumber=feat.properties.huisnummer" + ], + "mapRendering": [ + { + "label": { + "render": "
{addr:housenumber}
", + "condition": "addr:housenumber~*" + }, + "location": [ + "point", + "centroid" + ] + }, + { + "width": { + "render": 1 + } + } + ] + } + ], + "hideFromOverview": true +} \ No newline at end of file diff --git a/assets/themes/bag_import/license_info.json b/assets/themes/bag_import/license_info.json new file mode 100644 index 0000000000..0feae26b3f --- /dev/null +++ b/assets/themes/bag_import/license_info.json @@ -0,0 +1,10 @@ +[ + { + "path": "logo.svg", + "license": "CC0", + "authors": [ + "Wouter van der Wal" + ], + "sources": [] + } +] \ No newline at end of file diff --git a/assets/themes/bag_import/logo.svg b/assets/themes/bag_import/logo.svg new file mode 100644 index 0000000000..5b84e63d94 --- /dev/null +++ b/assets/themes/bag_import/logo.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 60452cb5b3..f32629be84 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -91,6 +91,10 @@ "if": "theme=artwork", "then": "./assets/themes/artwork/artwork.svg" }, + { + "if": "theme=bag", + "then": "./assets/themes/bag_import/logo.svg" + }, { "if": "theme=benches", "then": "./assets/themes/benches/bench_poi.svg" diff --git a/langs/themes/nl.json b/langs/themes/nl.json index 956c458894..c67611bbc0 100644 --- a/langs/themes/nl.json +++ b/langs/themes/nl.json @@ -11,6 +11,11 @@ "description": "Een vrije kaart met standbeelden, bustes, graffiti en andere kunstwerken van over de hele wereld", "title": "Open kunstwerken-kaart" }, + "bag": { + "description": "Dit thema helpt het importeren van BAG data", + "shortDescription": "BAG import helper tool", + "title": "BAG import helper" + }, "benches": { "description": "Deze kaart toont alle zitbanken die zijn opgenomen in OpenStreetMap: individuele banken en banken bij bushaltes. Met een OpenStreetMap-account kan je informatie verbeteren en nieuwe zitbanken toevoegen.", "shortDescription": "Een kaart van zitbanken", From b57548d46b365b106dbc0f1508416cd21f25f475 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Wed, 13 Jul 2022 12:47:07 +0200 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=9A=A7=20Show=20basic=20information?= =?UTF-8?q?=20as=20a=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index 2a25093d42..e8f3027d9f 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -21,17 +21,31 @@ "layers": [ { "id": "bag:pand", + "name": "bag:pand", + "title": "bag:pand", "description": "Buildings which come from the BAG", "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 18, "osmTags": { - "and": [ - "building~*" - ] + "and": ["building~*"] }, "maxCacheAge": 0 }, + "calculatedTags": [ + "ref:bag=feat.properties.identificatie", + "start_date=feat.properties.bouwjaar" + ], + "tagRenderings": [ + { + "id": "ref:bag", + "render": "{ref:bag}" + }, + { + "id": "start_date", + "render": "{start_date}" + } + ], "mapRendering": [ { "width": { @@ -49,25 +63,18 @@ "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 18, "osmTags": { - "and": [ - "building~*" - ] + "and": ["building~*"] }, "maxCacheAge": 0 }, - "calculatedTags": [ - "addr:housenumber=feat.properties.huisnummer" - ], + "calculatedTags": ["addr:housenumber=feat.properties.huisnummer"], "mapRendering": [ { "label": { "render": "
{addr:housenumber}
", "condition": "addr:housenumber~*" }, - "location": [ - "point", - "centroid" - ] + "location": ["point", "centroid"] }, { "width": { @@ -78,4 +85,4 @@ } ], "hideFromOverview": true -} \ No newline at end of file +} From 04d16aac6605d00af324fc2da0e340ef1a9ff9d7 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Thu, 14 Jul 2022 11:10:11 +0200 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=9A=A7=20Added=20building=20type=20?= =?UTF-8?q?and=20adress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index e8f3027d9f..efd997f683 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -22,29 +22,18 @@ { "id": "bag:pand", "name": "bag:pand", - "title": "bag:pand", - "description": "Buildings which come from the BAG", + "title": "bag:pand - {identificatie}", + "description": "Gebouwen vanaf het bag register", "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 18, "osmTags": { - "and": ["building~*"] + "and": ["identificatie~*"] }, "maxCacheAge": 0 }, "calculatedTags": [ - "ref:bag=feat.properties.identificatie", - "start_date=feat.properties.bouwjaar" - ], - "tagRenderings": [ - { - "id": "ref:bag", - "render": "{ref:bag}" - }, - { - "id": "start_date", - "render": "{start_date}" - } + "_osm_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')" ], "mapRendering": [ { @@ -59,15 +48,21 @@ }, { "id": "bag:verblijfsobject", + "name": "bag:verblijfsobject", + "title": "bag:verblijfsobject - {identificatie}", + "description": "Adressen vanaf het BAG register", "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", - "geoJsonZoomLevel": 18, + "geoJsonZoomLevel": 19, "osmTags": { - "and": ["building~*"] + "and": ["identificatie~*"] }, "maxCacheAge": 0 }, - "calculatedTags": ["addr:housenumber=feat.properties.huisnummer"], + "calculatedTags": [ + "addr:housenumber:=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`", + "adress=`${feat.properties.openbare_ruimte} ${feat.properties['addr:housenumber']} ${feat.properties.postcode} ${feat.properties.woonplaats}`" + ], "mapRendering": [ { "label": { From d111661f2e9d21860274bbf1cacea117bac41078 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Thu, 6 Oct 2022 14:28:36 +0200 Subject: [PATCH 04/10] =?UTF-8?q?=E2=9C=A8=20Show=20buildings=20from=20OSM?= =?UTF-8?q?=20-=20Show=20overlapping=20buildings=20-=20Show=20imported=20b?= =?UTF-8?q?uildings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 148 ++++++++++++++++++++++++++---- 1 file changed, 130 insertions(+), 18 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index efd997f683..aafd3927a3 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -11,7 +11,6 @@ }, "maintainer": "Wouter van der Wal", "icon": "./assets/themes/bag_import/logo.svg", - "version": "0", "startLat": 53.1726, "startLon": 7.04545, "startZoom": 9, @@ -20,32 +19,135 @@ }, "layers": [ { - "id": "bag:pand", - "name": "bag:pand", - "title": "bag:pand - {identificatie}", - "description": "Gebouwen vanaf het bag register", + "id": "osm:buildings", + "name": "OSM buildings", + "title": "OSM building", "source": { - "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", - "geoJsonZoomLevel": 18, - "osmTags": { - "and": ["identificatie~*"] - }, + "osmTags": "building~*", "maxCacheAge": 0 }, "calculatedTags": [ - "_osm_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')" + "_surface:strict:=feat.get('_surface')" ], "mapRendering": [ { "width": { - "render": 5 + "render": "2", + "mappings": [ + { + "if": "fixme~*", + "then": "5" + } + ] }, "color": { - "render": "#00a" + "render": "#00c", + "mappings": [ + { + "if": "fixme~*", + "then": "#ff00ff" + }, + { + "if": "building=house", + "then": "#a00" + }, + { + "if": "building=shed", + "then": "#563e02" + }, + { + "if": { + "or": [ + "building=garage", + "building=garages" + ] + }, + "then": "#f9bfbb" + }, + { + "if": "building=yes", + "then": "#0774f2" + } + ] } } ] }, + { + "id": "bag:pand", + "name": "bag:pand", + "title": "bag:pand - {identificatie}", + "description": { + "en": "Building from BAG register" + }, + "source": { + "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", + "geoJsonZoomLevel": 18, + "osmTags": { + "and": [ + "identificatie~*" + ] + }, + "maxCacheAge": 0 + }, + "calculatedTags": [ + "_overlaps_with_buildings=feat.overlapWith('osm:buildings').filter(f => f.feat.properties.id.indexOf('-') < 0)", + "_overlaps_with=feat.get('_overlaps_with_buildings').find(f => f.overlap > 1 /* square meter */ )", + "_overlaps_with_properties=feat.get('_overlaps_with')?.feat?.properties", + + "_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:start_date=feat.properties.bouwjaar", + + "_osm_obj:id=feat.get('_overlaps_with_properties')?.id", + "_osm_obj:building=feat.get('_overlaps_with_properties')?.building", + + "_imported_osm_object_found=Number(feat.properties.identificatie)==Number(feat.get('_overlaps_with_properties')['ref:bag'])" + ], + "mapRendering": [ + { + "width": { + "render": 5, + "mappings": [ + { + "if": "_imported_osm_object_found=true", + "then": "1" + } + ] + }, + "color": { + "render": "#00a", + "mappings": [ + { + "if": "_imported_osm_object_found=true", + "then": "#0f0" + } + ] + } + } + ], + "tagRenderings": [ + { + "id": "Build year", + "render": { + "en": "This building was build in {_bag_obj:start_date}" + } + }, + { + "id": "Building type", + "render": { + "en": "The building type is a {_bag_obj:building}" + } + }, + { + "id": "Overlapping building", + "render": "
The overlapping osm:buildings is a {_osm_obj:building} and covers {_overlap_percentage}% of the BAG building.
The BAG-building covers {_reverse_overlap_percentage}% of the OSM building

BAG geometry:

{minimap(21, id):height:10rem;border-radius:1rem;overflow:hidden}

OSM geometry:

{minimap(21,_osm_obj:id):height:10rem;border-radius:1rem;overflow:hidden}
", + "condition": "_overlaps_with!=" + } + ] + }, { "id": "bag:verblijfsobject", "name": "bag:verblijfsobject", @@ -55,13 +157,14 @@ "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 19, "osmTags": { - "and": ["identificatie~*"] + "and": [ + "identificatie~*" + ] }, "maxCacheAge": 0 }, "calculatedTags": [ - "addr:housenumber:=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`", - "adress=`${feat.properties.openbare_ruimte} ${feat.properties['addr:housenumber']} ${feat.properties.postcode} ${feat.properties.woonplaats}`" + "addr:housenumber:=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`" ], "mapRendering": [ { @@ -69,15 +172,24 @@ "render": "
{addr:housenumber}
", "condition": "addr:housenumber~*" }, - "location": ["point", "centroid"] + "location": [ + "point", + "centroid" + ] }, { "width": { "render": 1 } } + ], + "tagRenderings": [ + { + "id": "Adress", + "render": "{openbare_ruimte} {addr:housenumber}, {woonplaats} {postcode}" + } ] } ], "hideFromOverview": true -} +} \ No newline at end of file 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 05/10] =?UTF-8?q?=E2=9C=A8=20Added=20import=20button=20-?= =?UTF-8?q?=20Import=20button=20will=20show=20when=20the=20object=20isn't?= =?UTF-8?q?=20in=20osm=20-=20A=20conflate=20button=20to=20update=20data=20?= =?UTF-8?q?in=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": { From d2e2c4ab14716d78d354dcc677b1b540c75a0b64 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Thu, 6 Oct 2022 21:35:15 +0200 Subject: [PATCH 06/10] =?UTF-8?q?=F0=9F=8C=90=20Updated=20text=20-=20Fixed?= =?UTF-8?q?=20a=20small=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 53 +++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index 101ea2bee9..a20cc1d3c4 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -1,13 +1,16 @@ { "id": "bag", "title": { - "nl": "BAG import helper" + "nl": "BAG import helper", + "en": "BAG import helper" }, "shortDescription": { - "nl": "BAG import helper tool" + "nl": "BAG import helper tool", + "en": "BAG import helper tool" }, "description": { - "nl": "Dit thema helpt het importeren van BAG data" + "nl": "Dit thema helpt het importeren van BAG data", + "en": "This theme helps with importing data from BAG" }, "maintainer": "Wouter van der Wal", "icon": "./assets/themes/bag_import/logo.svg", @@ -20,8 +23,8 @@ "layers": [ { "id": "osm:buildings", - "name": "OSM buildings", - "title": "OSM building", + "name": "OSM Buildings", + "title": "OSM Building", "source": { "osmTags": "building~*", "maxCacheAge": 0 @@ -75,10 +78,10 @@ }, { "id": "bag:pand", - "name": "bag:pand", - "title": "bag:pand - {identificatie}", + "name": "BAG Buildings", + "title": "BAG Building", "description": { - "en": "Building from BAG register" + "en": "Buildings from BAG register" }, "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", @@ -137,10 +140,6 @@ "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": [ @@ -150,20 +149,46 @@ ] }, "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)}" + }, + { + "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)}" } ] }, + { + "id": "Reference", + "render": { + "en": "The reference in BAG is {_bag_obj:ref:bag}" + } + }, { "id": "Build year", "render": { "en": "This building was build in {_bag_obj:start_date}" - } + }, + "mappings": [ + { + "if": "_bag_obj:in_construction=true", + "then": { + "en": "The building was started in {_bag_obj:start_date}" + } + } + ] }, { "id": "Building type", "render": { "en": "The building type is a {_bag_obj:building}" - } + }, + "mappings": [ + { + "if": "_bag_obj:in_construction=true", + "then": { + "en": "The building type will be a {_bag_obj:construction}" + } + } + ] }, { "id": "Overlapping building", From d280237f89c050cedf44ce9da67ad62ca74461db Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Thu, 6 Oct 2022 21:50:12 +0200 Subject: [PATCH 07/10] =?UTF-8?q?=E2=9C=A8=20Added=20an=20options=20to=20c?= =?UTF-8?q?hange=20building=20type=20of=20osm=20building?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 75 ++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index a20cc1d3c4..4f562e9ecf 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -12,7 +12,7 @@ "nl": "Dit thema helpt het importeren van BAG data", "en": "This theme helps with importing data from BAG" }, - "maintainer": "Wouter van der Wal", + "credits": "Wouter van der Wal", "icon": "./assets/themes/bag_import/logo.svg", "startLat": 53.1726, "startLon": 7.04545, @@ -74,6 +74,75 @@ ] } } + ], + "tagRenderings": [ + { + "id": "Reference", + "render": { + "en": "The reference in BAG is {ref:bag}" + }, + "mappings": [ + { + "if": "ref:bag=", + "then": { + "en": "This building has no reference in the BAG" + } + } + ] + }, + { + "id": "building type", + "freeform": { + "key": "building" + }, + "render": "The building type is {building}", + "question": { + "en": "What kind of building is this?", + "de": "Was ist das für ein Gebäude?", + "es": "¿Qué tipo de edificio es este?", + "nl": "Wat voor soort gebouw is dit?", + "fr": "De quel type de bâtiment s’agit-il ?", + "da": "Hvad er det for en bygning?" + }, + "mappings": [ + { + "if": "building=house", + "then": "A normal house" + }, + { + "if": "building=detached", + "then": "A house detached from other building" + }, + { + "if": "building=semidetached_house", + "then": "A house sharing only one wall with another house" + }, + { + "if": "building=apartments", + "then": "An apartment building (highrise building for living)" + }, + { + "if": "building=office", + "then": "An office building - highrise for work" + }, + { + "if": "building=shed", + "then": "A small shed, e.g. in a garden" + }, + { + "if": "building=garage", + "then": "A single garage to park a car" + }, + { + "if": "building=garages", + "then": "A building containing only garages; typically they are all identical" + }, + { + "if": "building=yes", + "then": "A building - no specification" + } + ] + } ] }, { @@ -97,20 +166,16 @@ "_overlaps_with_buildings=feat.overlapWith('osm:buildings').filter(f => f.feat.properties.id.indexOf('-') < 0)", "_overlaps_with=feat.get('_overlaps_with_buildings').find(f => f.overlap > 1 /* square meter */ )", "_overlaps_with_properties=feat.get('_overlaps_with')?.feat?.properties", - "_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: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", "_osm_obj:building=feat.get('_overlaps_with_properties')?.building", - "_imported_osm_object_found=Number(feat.properties.identificatie)==Number(feat.get('_overlaps_with_properties')['ref:bag'])" ], "mapRendering": [ From 44bafa431839cf21e1599fbe064630a8f6c19f3f Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Fri, 7 Oct 2022 13:29:46 +0200 Subject: [PATCH 08/10] =?UTF-8?q?=E2=9C=A8=20Updated=20building=20type=20q?= =?UTF-8?q?uestion,=20auto=20remove=20construction=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 65 +++++-------------------------- 1 file changed, 9 insertions(+), 56 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index 4f562e9ecf..0188d59381 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -91,57 +91,16 @@ ] }, { - "id": "building type", + "id": "Building type", "freeform": { - "key": "building" + "key": "building", + "type": "string", + "addExtraTags": [ + "construction=" + ] }, - "render": "The building type is {building}", - "question": { - "en": "What kind of building is this?", - "de": "Was ist das für ein Gebäude?", - "es": "¿Qué tipo de edificio es este?", - "nl": "Wat voor soort gebouw is dit?", - "fr": "De quel type de bâtiment s’agit-il ?", - "da": "Hvad er det for en bygning?" - }, - "mappings": [ - { - "if": "building=house", - "then": "A normal house" - }, - { - "if": "building=detached", - "then": "A house detached from other building" - }, - { - "if": "building=semidetached_house", - "then": "A house sharing only one wall with another house" - }, - { - "if": "building=apartments", - "then": "An apartment building (highrise building for living)" - }, - { - "if": "building=office", - "then": "An office building - highrise for work" - }, - { - "if": "building=shed", - "then": "A small shed, e.g. in a garden" - }, - { - "if": "building=garage", - "then": "A single garage to park a car" - }, - { - "if": "building=garages", - "then": "A building containing only garages; typically they are all identical" - }, - { - "if": "building=yes", - "then": "A building - no specification" - } - ] + "render": "This building is a {building}", + "question": "What kind of building is this?" } ] }, @@ -206,13 +165,7 @@ "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": { - "and": [ - "_overlap_percentage>50", - "_reverse_overlap_percentage>50", - "_overlaps_with!=" - ] - }, + "if": "_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)}" }, { From 46613d7e1781fd017b945811bb65dd6dd0591e42 Mon Sep 17 00:00:00 2001 From: wjtje <33957974+wjtje@users.noreply.github.com> Date: Sun, 9 Oct 2022 21:39:23 +0200 Subject: [PATCH 09/10] =?UTF-8?q?=E2=9C=A8=20Added=20option=20to=20upload?= =?UTF-8?q?=20adress=20from=20BAG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/themes/bag_import/bag.json | 88 ++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index 0188d59381..c551549d77 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -104,6 +104,40 @@ } ] }, + { + "id": "osm:adresses", + "name": "OSM Adresses", + "title": "OSM Adress", + "source": { + "osmTags": { + "and": [ + "source=BAG", + "addr:city~*", + "addr:housenumber~*", + "addr:postcode~*", + "addr:street~*" + ] + }, + "maxCacheAge": 0 + }, + "mapRendering": [ + { + "label": { + "render": "
{addr:housenumber}
", + "condition": "addr:housenumber~*" + }, + "location": [ + "point", + "centroid" + ] + }, + { + "width": { + "render": 1 + } + } + ] + }, { "id": "bag:pand", "name": "BAG Buildings", @@ -114,11 +148,7 @@ "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Apand&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 18, - "osmTags": { - "and": [ - "identificatie~*" - ] - }, + "osmTags": "identificatie~*", "maxCacheAge": 0 }, "calculatedTags": [ @@ -135,7 +165,7 @@ "_bag_obj:start_date=feat.properties.bouwjaar", "_osm_obj:id=feat.get('_overlaps_with_properties')?.id", "_osm_obj:building=feat.get('_overlaps_with_properties')?.building", - "_imported_osm_object_found=Number(feat.properties.identificatie)==Number(feat.get('_overlaps_with_properties')['ref:bag'])" + "_imported_osm_object_found:=Number(feat.properties.identificatie)==Number(feat.get('_overlaps_with_properties')['ref:bag'])" ], "mapRendering": [ { @@ -212,32 +242,49 @@ "id": "Overlapping building", "render": "
The overlapping osm:buildings is a {_osm_obj:building} and covers {_overlap_percentage}% of the BAG building.
The BAG-building covers {_reverse_overlap_percentage}% of the OSM building

BAG geometry:

{minimap(21, id):height:10rem;border-radius:1rem;overflow:hidden}

OSM geometry:

{minimap(21,_osm_obj:id):height:10rem;border-radius:1rem;overflow:hidden}
", "condition": "_overlaps_with!=" + }, + { + "id": "Building status", + "render": "The current building status is {status}" + }, + { + "id": "Buidling function", + "render": "The current function of the building is {gebruiksdoel}" } ] }, { "id": "bag:verblijfsobject", - "name": "bag:verblijfsobject", - "title": "bag:verblijfsobject - {identificatie}", - "description": "Adressen vanaf het BAG register", + "name": "BAG Addresses", + "title": "BAG Address", + "description": "Adress information from the BAG register", "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 19, - "osmTags": { - "and": [ - "identificatie~*" - ] - }, + "osmTags": "identificatie~*", "maxCacheAge": 0 }, "calculatedTags": [ - "addr:housenumber:=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`" + "_closed_osm_addr:=feat.closest('osm:adresses').properties", + "_bag_obj:addr:housenumber=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`", + "_bag_obj:ref:bag=Number(feat.properties.identificatie)", + "_bag_obj:source:date=new Date().toISOString().split('T')[0]", + "_osm_obj:addr:city:=feat.get('_closed_osm_addr')['addr:city']", + "_osm_obj:addr:housenumber:=feat.get('_closed_osm_addr')['addr:housenumber']", + "_osm_obj:addr:postcode:=feat.get('_closed_osm_addr')['addr:postcode']", + "_osm_obj:addr:street:=feat.get('_closed_osm_addr')['addr:street']", + "_imported_osm_object_found:=(feat.properties.woonplaats==feat.get('_closed_osm_addr')['addr:city'])&&(feat.get('_bag_obj:addr:housenumber')==feat.get('_closed_osm_addr')['addr:housenumber'])&&(feat.properties.postcode==feat.get('_closed_osm_addr')['addr:postcode'])&&(feat.properties.openbare_ruimte==feat.get('_closed_osm_addr')['addr:street'])" ], "mapRendering": [ { "label": { - "render": "
{addr:housenumber}
", - "condition": "addr:housenumber~*" + "render": "
{_bag_obj:addr:housenumber}
", + "mappings": [ + { + "if": "_imported_osm_object_found=true", + "then": "
{_bag_obj:addr:housenumber}
" + } + ] }, "location": [ "point", @@ -251,9 +298,14 @@ } ], "tagRenderings": [ + { + "id": "Import button", + "render": "{import_button(osm:adresses, addr:city=$woonplaats; addr:housenumber=$_bag_obj:addr:housenumber; addr:postcode=$postcode; addr:street=$openbare_ruimte; ref:bag=$_bag_obj:ref:bag; source=BAG; source:date=$_bag_obj:source:date, Upload this adress to OpenStreetMap)}", + "condition": "_imported_osm_object_found=false" + }, { "id": "Adress", - "render": "{openbare_ruimte} {addr:housenumber}, {woonplaats} {postcode}" + "render": "{openbare_ruimte} {_bag_obj:addr:housenumber}, {woonplaats} {postcode}" } ] } From 7b37c248b2d4102c19b826c49cb6ea7aebd89963 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Mon, 10 Oct 2022 10:11:03 +0200 Subject: [PATCH 10/10] Add some descriptions, move minzoom --- assets/themes/bag_import/bag.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/themes/bag_import/bag.json b/assets/themes/bag_import/bag.json index c551549d77..c4934eb7d3 100644 --- a/assets/themes/bag_import/bag.json +++ b/assets/themes/bag_import/bag.json @@ -17,18 +17,17 @@ "startLat": 53.1726, "startLon": 7.04545, "startZoom": 9, - "overrideAll": { - "minzoom": 19 - }, "layers": [ { "id": "osm:buildings", "name": "OSM Buildings", "title": "OSM Building", + "description": "Layer showing buildings that are in OpenStreetMap", "source": { "osmTags": "building~*", "maxCacheAge": 0 }, + "minzoom": 19, "calculatedTags": [ "_surface:strict:=feat.get('_surface')" ], @@ -108,6 +107,7 @@ "id": "osm:adresses", "name": "OSM Adresses", "title": "OSM Adress", + "description": "Layer showing adresses that are in OpenStreetMap", "source": { "osmTags": { "and": [ @@ -120,6 +120,7 @@ }, "maxCacheAge": 0 }, + "minzoom": 19, "mapRendering": [ { "label": { @@ -151,6 +152,7 @@ "osmTags": "identificatie~*", "maxCacheAge": 0 }, + "minzoom": 19, "calculatedTags": [ "_overlaps_with_buildings=feat.overlapWith('osm:buildings').filter(f => f.feat.properties.id.indexOf('-') < 0)", "_overlaps_with=feat.get('_overlaps_with_buildings').find(f => f.overlap > 1 /* square meter */ )", @@ -213,7 +215,7 @@ { "id": "Build year", "render": { - "en": "This building was build in {_bag_obj:start_date}" + "en": "This building was built in {_bag_obj:start_date}" }, "mappings": [ { @@ -257,13 +259,14 @@ "id": "bag:verblijfsobject", "name": "BAG Addresses", "title": "BAG Address", - "description": "Adress information from the BAG register", + "description": "Address information from the BAG register", "source": { "geoJson": "https://service.pdok.nl/lv/bag/wfs/v2_0?request=GetFeature&service=WFS&version=2.0.0&outputFormat=application%2Fjson%3B%20subtype%3Dgeojson&typeName=bag%3Averblijfsobject&bbox={x_min}%2C{y_min}%2C{x_max}%2C{y_max}%2CCRS84&srsName=EPSG%3A4326", "geoJsonZoomLevel": 19, "osmTags": "identificatie~*", "maxCacheAge": 0 }, + "minzoom": 19, "calculatedTags": [ "_closed_osm_addr:=feat.closest('osm:adresses').properties", "_bag_obj:addr:housenumber=`${feat.properties.huisnummer}${feat.properties.huisletter}${(feat.properties.toevoeging != '') ? '-' : ''}${feat.properties.toevoeging}`", @@ -304,11 +307,11 @@ "condition": "_imported_osm_object_found=false" }, { - "id": "Adress", + "id": "Address", "render": "{openbare_ruimte} {_bag_obj:addr:housenumber}, {woonplaats} {postcode}" } ] } ], "hideFromOverview": true -} \ No newline at end of file +}