This repository contains the code, data, and documentation for creating an interactive map of local 7-day COVID-19 incidence rates in Germany, developed as part of a Master's thesis in collaboration with INWT Statistics and Freie Universität Berlin.
The project demonstrates how to model, process, and visualize official COVID-19 infection data from the Robert Koch Institute (RKI) using R and JavaScript.
The live version is available at:
https://www.inwt-statistics.de/blog/covid-19_karte_der_lokalen_7-tage-inzidenz_im_zeitverlauf
This project combines statistical modeling and web visualization:
- Modeling in R – uses the
Kernelheapingpackage to generate smooth spatial incidence estimates from aggregated district-level data. - ETL Processing in JavaScript – prepares model output for visualization.
- Web App – renders an interactive incidence map for exploration at the district level.
The method provides a realistic spatial representation of COVID-19 incidence, avoiding the artificial discontinuities of traditional choropleth maps.
| Folder | Description |
|---|---|
model/ |
R code and data for incidence calculation |
etl/ |
JavaScript scripts for data transformation |
app/ |
Frontend application for interactive map visualization |
docs/ |
Documentation (in English and German) |
- R (with packages:
dplyr,ggplot2,Kernelheaping,geojsonio,sf,jsonlite, etc.) - Node.js (portable version supported; no admin rights required)
- Command line access (CMD, Terminal, or PowerShell)
To reproduce the full workflow, please refer to the detailed documentation in the docs/ folder — available in English and German.
In short:
-
Run the R model to calculate local incidence estimates.
-
Process the generated data using Node.js.
-
Launch the app locally.
The kernel heaping approach (see Groß & Rendtel, 2016; Rendtel et al., 2021) estimates realistic spatial density distributions from aggregated regional data.
It:
- Smooths incidence rates across borders
- Reduces artificial jumps at district boundaries
- Enables re-aggregation into non-hierarchical regional systems
- Identifies local hotspots more accurately
| Source | License | Link |
|---|---|---|
| Robert Koch Institute (RKI) | CC BY 4.0 | https://github.com/robert-koch-institut/SARS-CoV-2-Infektionen_in_Deutschland |
| Federal Agency for Cartography and Geodesy (BKG) | Data License Germany – Attribution – Version 2.0 | https://daten.gdz.bkg.bund.de/produkte/vg/nuts250_1231/ |
- Code: MIT License
- Data: © GeoBasis-DE / BKG 2023 – Data License Germany – Attribution – Version 2.0
- RKI data: © Robert Koch Institute (CC BY 4.0)