2022-07-12 23:48:22 +02:00
{
"id" : "bag" ,
"title" : {
2022-10-06 21:35:15 +02:00
"nl" : "BAG import helper" ,
"en" : "BAG import helper"
2022-07-12 23:48:22 +02:00
} ,
"shortDescription" : {
2022-10-06 21:35:15 +02:00
"nl" : "BAG import helper tool" ,
"en" : "BAG import helper tool"
2022-07-12 23:48:22 +02:00
} ,
"description" : {
2022-10-06 21:35:15 +02:00
"nl" : "Dit thema helpt het importeren van BAG data" ,
"en" : "This theme helps with importing data from BAG"
2022-07-12 23:48:22 +02:00
} ,
2022-10-06 21:50:12 +02:00
"credits" : "Wouter van der Wal" ,
2022-07-12 23:48:22 +02:00
"icon" : "./assets/themes/bag_import/logo.svg" ,
"startLat" : 53.1726 ,
"startLon" : 7.04545 ,
"startZoom" : 9 ,
"overrideAll" : {
"minzoom" : 19
} ,
"layers" : [
2022-10-06 14:28:36 +02:00
{
"id" : "osm:buildings" ,
2022-10-06 21:35:15 +02:00
"name" : "OSM Buildings" ,
"title" : "OSM Building" ,
2022-10-06 14:28:36 +02:00
"source" : {
"osmTags" : "building~*" ,
"maxCacheAge" : 0
} ,
"calculatedTags" : [
"_surface:strict:=feat.get('_surface')"
] ,
"mapRendering" : [
{
"width" : {
"render" : "2" ,
"mappings" : [
{
"if" : "fixme~*" ,
"then" : "5"
}
]
} ,
"color" : {
"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"
}
]
}
}
2022-10-06 21:50:12 +02:00
] ,
"tagRenderings" : [
{
"id" : "Reference" ,
"render" : {
"en" : "The reference in BAG is <b>{ref:bag}</b>"
} ,
"mappings" : [
{
"if" : "ref:bag=" ,
"then" : {
"en" : "This building has no reference in the BAG"
}
}
]
} ,
{
2022-10-07 13:29:46 +02:00
"id" : "Building type" ,
2022-10-06 21:50:12 +02:00
"freeform" : {
2022-10-07 13:29:46 +02:00
"key" : "building" ,
"type" : "string" ,
"addExtraTags" : [
"construction="
]
2022-10-06 21:50:12 +02:00
} ,
2022-10-07 13:29:46 +02:00
"render" : "This building is a <b>{building}</b>" ,
"question" : "What kind of building is this?"
2022-10-06 21:50:12 +02:00
}
2022-10-06 14:28:36 +02:00
]
} ,
2022-10-09 21:39:23 +02:00
{
"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" : "<div style='color: black' class='rounded-full p-1 font-bold relative'>{addr:housenumber}</div>" ,
"condition" : "addr:housenumber~*"
} ,
"location" : [
"point" ,
"centroid"
]
} ,
{
"width" : {
"render" : 1
}
}
]
} ,
2022-07-12 23:48:22 +02:00
{
"id" : "bag:pand" ,
2022-10-06 21:35:15 +02:00
"name" : "BAG Buildings" ,
"title" : "BAG Building" ,
2022-10-06 14:28:36 +02:00
"description" : {
2022-10-06 21:35:15 +02:00
"en" : "Buildings from BAG register"
2022-10-06 14:28:36 +02:00
} ,
2022-07-12 23:48:22 +02:00
"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 ,
2022-10-09 21:39:23 +02:00
"osmTags" : "identificatie~*" ,
2022-07-12 23:48:22 +02:00
"maxCacheAge" : 0
} ,
2022-07-13 12:47:07 +02:00
"calculatedTags" : [
2022-10-06 14:28:36 +02:00
"_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')))" ,
2022-10-06 15:06:49 +02:00
"_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]" ,
2022-10-06 14:28:36 +02:00
"_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" ,
2022-10-09 21:39:23 +02:00
"_imported_osm_object_found:=Number(feat.properties.identificatie)==Number(feat.get('_overlaps_with_properties')['ref:bag'])"
2022-07-13 12:47:07 +02:00
] ,
2022-07-12 23:48:22 +02:00
"mapRendering" : [
{
"width" : {
2022-10-06 14:28:36 +02:00
"render" : 5 ,
"mappings" : [
{
"if" : "_imported_osm_object_found=true" ,
"then" : "1"
}
]
2022-07-12 23:48:22 +02:00
} ,
"color" : {
2022-10-06 14:28:36 +02:00
"render" : "#00a" ,
"mappings" : [
{
"if" : "_imported_osm_object_found=true" ,
"then" : "#0f0"
}
]
}
}
] ,
"tagRenderings" : [
2022-10-06 15:06:49 +02:00
{
"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" : [
{
2022-10-07 13:29:46 +02:00
"if" : "_overlaps_with!=" ,
2022-10-06 15:06:49 +02:00
"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)}"
2022-10-06 21:35:15 +02:00
} ,
{
"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)}"
2022-10-06 15:06:49 +02:00
}
]
} ,
2022-10-06 21:35:15 +02:00
{
"id" : "Reference" ,
"render" : {
"en" : "The reference in BAG is <b>{_bag_obj:ref:bag}</b>"
}
} ,
2022-10-06 14:28:36 +02:00
{
"id" : "Build year" ,
"render" : {
"en" : "This building was build in <b>{_bag_obj:start_date}</b>"
2022-10-06 21:35:15 +02:00
} ,
"mappings" : [
{
"if" : "_bag_obj:in_construction=true" ,
"then" : {
"en" : "The building was started in <b>{_bag_obj:start_date}</b>"
}
}
]
2022-10-06 14:28:36 +02:00
} ,
{
"id" : "Building type" ,
"render" : {
"en" : "The building type is a <b>{_bag_obj:building}</b>"
2022-10-06 21:35:15 +02:00
} ,
"mappings" : [
{
"if" : "_bag_obj:in_construction=true" ,
"then" : {
"en" : "The building type will be a <b>{_bag_obj:construction}</b>"
}
}
]
2022-10-06 14:28:36 +02:00
} ,
{
"id" : "Overlapping building" ,
"render" : "<div>The overlapping <a href=https://osm.org/{_osm_obj:id} target=_blank>osm:buildings</a> is a <b>{_osm_obj:building}</b> and covers <b>{_overlap_percentage}%</b> of the BAG building.<br>The BAG-building covers <b>{_reverse_overlap_percentage}%</b> of the OSM building<div><h3>BAG geometry:</h3>{minimap(21, id):height:10rem;border-radius:1rem;overflow:hidden}<h3>OSM geometry:</h3>{minimap(21,_osm_obj:id):height:10rem;border-radius:1rem;overflow:hidden}</div></div>" ,
"condition" : "_overlaps_with!="
2022-10-09 21:39:23 +02:00
} ,
{
"id" : "Building status" ,
"render" : "The current building status is <b>{status}</b>"
} ,
{
"id" : "Buidling function" ,
"render" : "The current function of the building is <b>{gebruiksdoel}</b>"
2022-07-12 23:48:22 +02:00
}
]
} ,
{
"id" : "bag:verblijfsobject" ,
2022-10-09 21:39:23 +02:00
"name" : "BAG Addresses" ,
"title" : "BAG Address" ,
"description" : "Adress information from the BAG register" ,
2022-07-12 23:48:22 +02:00
"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" ,
2022-07-14 11:10:11 +02:00
"geoJsonZoomLevel" : 19 ,
2022-10-09 21:39:23 +02:00
"osmTags" : "identificatie~*" ,
2022-07-12 23:48:22 +02:00
"maxCacheAge" : 0
} ,
2022-07-14 11:10:11 +02:00
"calculatedTags" : [
2022-10-09 21:39:23 +02:00
"_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'])"
2022-07-14 11:10:11 +02:00
] ,
2022-07-12 23:48:22 +02:00
"mapRendering" : [
{
"label" : {
2022-10-09 21:39:23 +02:00
"render" : "<div style='color: black' class='rounded-full p-1 font-bold relative'>{_bag_obj:addr:housenumber}</div>" ,
"mappings" : [
{
"if" : "_imported_osm_object_found=true" ,
"then" : "<div style='color: #107c10' class='rounded-full p-1 font-bold relative'>{_bag_obj:addr:housenumber}</div>"
}
]
2022-07-12 23:48:22 +02:00
} ,
2022-10-06 14:28:36 +02:00
"location" : [
"point" ,
"centroid"
]
2022-07-12 23:48:22 +02:00
} ,
{
"width" : {
"render" : 1
}
}
2022-10-06 14:28:36 +02:00
] ,
"tagRenderings" : [
2022-10-09 21:39:23 +02:00
{
"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"
} ,
2022-10-06 14:28:36 +02:00
{
"id" : "Adress" ,
2022-10-09 21:39:23 +02:00
"render" : "{openbare_ruimte} {_bag_obj:addr:housenumber}, {woonplaats} {postcode}"
2022-10-06 14:28:36 +02:00
}
2022-07-12 23:48:22 +02:00
]
}
] ,
"hideFromOverview" : true
2022-10-06 14:28:36 +02:00
}