Skip to contents

Kadaster's Basisregistratie Adressen en Gebouwen database contains for all buildings in the Netherlands their location and postcode. pollutionFromBag() finds the geo-location of all buildings part of the given postcodes. Then extracts the air pollutant concentrations at those geo-locations from ELAPSE. Returned are all pollution estimates for every building in the wanted postcodes, including the geo-location.

Usage

pollutionFromBag(postcodes, bag_path, elapse_path, ...)

Arguments

postcodes

string or vector of strings Containing Duch postcodes.

bag

string Path to BAG database.

elapse

optional Path to ELAPSE. (When empty will load internal ELAPSE)

Value

data.frame containing air pollution estimates and geo-location for all buildings in the given postcodes

Examples

if (FALSE) { # \dontrun{
## Packages used in plotting
library(tidyverse)
library(tidyterra)

## Get the spacial points associated with postcodes.
data("oneHunderdAddresses")

bag <- pollutionFromBag(oneHunderdAddresses, "./data/bag-light.gpkg")

head(bag, 5)

## Plot the spacial features, and NO2 concentration across the Netherlands.
elapse <- loadElapse()

ggplot() +
  geom_spatraster(data = elapse$NO2FULL) +
  geom_sf(data = bag, aes(geometry = geom), colour = "orange") +
  scale_fill_grass_c(transform = "log10")
} # }