Skip to contents

Overview

The goal of postcodElapse is to estimate the levels of air pollution, including fine particulate matter (PM2.5), black carbon (BC), nitrogen dioxide (NO2) and ozone (O3) at the postal code level in the Netherlands and provides an alternative to on-site measurements.

This is achieved by:

  1. Obtaining postal code-derived spatial information (points or areas) from one of two supported GeoPackages.
  2. Linking these locations to the ELAPSE air quality Land Use Regression model.
  3. Estimating postal code-derived levels of air pollutants in µg/m3.

This vignette is a guide for setting up, running and utilizing postcodElapse.

GeoPackages

As described above, the spatial data of a postal code is required in order to estimate air pollutant concentrations. PostcodElapse requires this data to be provided in a GeoPackage (.gpkg) file, a format commonly used for storing spatial data.

Currently, postcodElapse supports two GeoPackages:

  1. BAG (Basisregistratie Adressen en Gebouwen) contains for every building in the Netherlands the location and postal code. Size 8GB

  2. PC6 (Postcode6) provides the geographic area for every Dutch postal code. Size 0.5GB

PostcodElapse requires that these GeoPackages are stored locally in the current Working Directory of your R session.

Estimating exposures

To estimate the air pollutant levels, call the main function postcodElapse() with a postcode (can also be a vector) and the file path to the relevant GeoPackage.

library(postcodElapse)

postcodElapse("9713AV", "bag-light.gpkg")
#> Guessed db type to be: BAG
#>   postcode n BCFULL_avg NO2FULL_avg O3FULLa_avg O3FULLc_avg O3FULLw_avg
#> 1   9713AV 1   1.878818    31.10718    60.04483     44.7972    77.85616
#>   PM25FULLt_avg BCFULL_min NO2FULL_min O3FULLa_min O3FULLc_min O3FULLw_min
#> 1       15.4238   1.878818    31.10718    60.04483     44.7972    77.85616
#>   PM25FULLt_min BCFULL_max NO2FULL_max O3FULLa_max O3FULLc_max O3FULLw_max
#> 1       15.4238   1.878818    31.10718    60.04483     44.7972    77.85616
#>   PM25FULLt_max
#> 1       15.4238

In this example, the BAG is used. The output structure is identical when using PC6; only the database file path needs adjusting. postcodElapse() returns a data frame in which each row corresponds to a postcode. Columns include:

  • The postcode
  • Number of buildings in that postcode n.
  • Mean, minimum & maximum concentration for all air pollutants, in µg/m3.

PostcodElapse includes the “oneHunderdAddresses” demo-dataset it conatins an 100 Duch postal addresses, randomly sampled from both GeoPackages. Load it using data("oneHunderdAddresses").

data("oneHunderdAddresses")

head(oneHunderdAddresses)
#> [1] "2694BH" "9686NH" "2514LX" "6835MH" "9717LD" "3723EK"

estimates <- postcodElapse(oneHunderdAddresses, "cbs_pc6_2024.gpkg")
#> Guessed db type to be: PC6

head(estimates, 5)
#>   postcode   n BCFULL_avg NO2FULL_avg O3FULLa_avg O3FULLc_avg O3FULLw_avg
#> 1   1055LZ  30   2.152679    47.92073    48.13478    36.28936    52.74254
#> 2   1068BS  25   1.701343    36.03498    54.87814    39.16438    66.80187
#> 3   1075CR  20   2.121569    42.52370    54.33167    37.15707    65.54469
#> 4   1186GP 115   1.619018    34.56064    57.31758    38.56885    74.62107
#> 5   1222RP  15   1.727729    35.62143    54.20006    37.05156    74.62482
#>   PM25FULLt_avg BCFULL_min NO2FULL_min O3FULLa_min O3FULLc_min O3FULLw_min
#> 1      18.69952   1.982936    44.26031    46.24104    36.21948    52.32673
#> 2      16.28975   1.696246    35.90311    54.85917    38.97618    66.73665
#> 3      17.36451   2.106007    41.10803    54.12944    37.04370    65.19234
#> 4      15.61553   1.592608    33.22308    56.70871    38.11225    73.97521
#> 5      16.37185   1.700418    35.40251    53.54480    36.60494    73.98518
#>   PM25FULLt_min BCFULL_max NO2FULL_max O3FULLa_max O3FULLc_max O3FULLw_max
#> 1      18.43949   2.322422    51.58115    50.02851    36.35924    53.15836
#> 2      16.27069   1.706440    36.16685    54.89712    39.35259    66.86710
#> 3      17.22134   2.126170    42.77146    55.67873    38.16626    66.79316
#> 4      15.35053   1.646049    35.88888    57.72419    38.98361    74.98950
#> 5      16.29307   1.787439    36.75730    54.89755    37.45749    76.16751
#>   PM25FULLt_max
#> 1      18.95955
#> 2      16.30882
#> 3      17.53084
#> 4      15.79089
#> 5      16.56795

With the material above, you can utilize the core functionality postcodElapse provides.