For instructions for setting up PostgreSQL and Python, see docs/installation.md.
In order to run the code, the configuration file config.yml
must be filled out.
Plot settings can be changed in scripts/settings/plotting.py
.
Next, to create the required folder structure, navigate to the main folder in a terminal window and run the Python file setup_folders.py
python setup_folders.py
This should return:
Successfully created folder data
Successfully created folder results
...
The analysis makes use of 5 input data sets:
- A road network data set split into an edge and a node table
- A polygon data set with the Danish municipal boundaries
- A polygon data set with socio-economic data on population density, income etc.
- A polygon data set with areas classified as urban.
- A raster data set with a population density grid.
The road network data set is prepared using dk_bicycle_network.
The edge and node tables are imported in script 01_load_data.py
. For successfull data import, provide/update the table names of the input tables and the input database as needed (config.yml
).
A data set with the name and spatial extent of all municipalities is provided as ../data/input/municipalities/muni_boundaries.gpkg
. Update with more recent input data as needed, but do not change the filepath or attributes in the input data set.
A data set with socio-economic variables for all voting areas is provided as ../data/processed/voting_areas.gpkg
. Update with more recent input data as needed, but do not change the filepath or attributes in the input data set. To recreate the data with newer input data, replace the files in ../data/input/socioeconomic
and run script 00_prepare_socioeconomic_data.py
.
A data set with polygons representing areas classified as urban, provided as ../data/input/urban/urban_areas.parquet
. Update with more recent input data as needed, but do not change the filepath or attributes in the input data set.
Get the latest population data from GHSL: https://human-settlement.emergency.copernicus.eu/download.php?ds=pop.
- Download the two raster data sets covering the entire extent of Denmark.
- Place the downloaded zip-files in the folder
data/population/
. - Unzip the zip files.
- Update the filepaths
pop_fp_1
andpop_fp_2
inconfig.yml
if needed.
-
Run all Python scripts in the
scripts
folder in consecutive order. The full analysis will take several hours to complete, depending on your machine. -
All results are stored in the
results
folder.