This is the source code for reproducing the scientific project Quality assessment of a country-wide bicycle node network with loop census analysis. The code assesses the quality of a Bicycle Node Network via loop census analysis. See also the related QGIS tool BikeNodePlanner.
Preprint: https://arxiv.org/abs/2604.07029
Data repository: zenodo.19222642

Output from running the code on Denmark, showing round trip options for a family with small children
To install and use the code, you need to have installed JupyterLab.
First clone the repository:
git clone https://github.com/mszell/bikenwloops
Go to the cloned folder.
Installation with pixi is fastest and most stable. Setup a new virtual environment using the environment.yml file:
pixi init --import environment.yml
Now build the environment and run it:
pixi run jupyter lab
An instance of Jupyter lab is automatically going to open in your browser after the environment is built.
Alternatively, use mamba (or conda, which is slower).
Instructions
Create a new virtual environment using the `environment.yml` file:mamba env create -f environment.yml
Then, install the virtual environment's kernel in Jupyter:
mamba activate bikenwloops
ipython kernel install --user --name=bikenwloops
mamba deactivate
You can now run Jupyter jupyter lab with the kernel bikenwloops (Kernel > Change Kernel > bikenwloops).
Download the data from zenodo: https://zenodo.org/records/19222642
Unpack the data folder into the folder of the repository. This is the data set to reproduce the paper.
There are several numbered notebooks which need to be run in a certain order and with specific config settings. Here are the instructions to reproduce the paper.
- In the config.yml, set
study_area: bornholm. Run notebook 00. Repeat this step for the other 5 study areasfunen,jutland,lollandfalster,longland,zealand. - In the config.yml, set
study_area: denmark. - Run notebook 01.
- Run notebook 02.
- Run notebook 03.
- In the config.yml, set
scenarioid: 0. Run notebook 04. Repeat this step for the other 2 scenarioids1and2. - In the config.yml, set
scenarioid: 0. Run notebook 05. Repeat this step for the other 2 scenarioids1and2. - Run notebook 06.
- Run notebook 07.
Data of the knudepunkter network comes from BikeNodePlanner: Data for Denmark and BikeNodePlanner.
Caution
All necessary data to reproduce the paper have been assembled in the zenodo repository, so it is not necessary nor recommended to re-do this data retrieval.
Nevertheless, here we provide our original steps to retrieve and assemble the data.
- Use BikeNodePlanner: Data for Denmark
- Uncomment the municipalities of your study area in
config-municipalities.yml. Several config files are already prepared for copy-pasting in theparameters/dataretrieval/folder for large study areas like Jutland or Zealand. - Set all values in
config-layers-polygon.ymltoignore. This file is already prepared for copy-pasting. - Run the
run.shscript - Copy all subfolders of
/input-for-bike-node-planner/into the/data/input/folder of bike-node-planner
This step is needed to add elevation data (from dem/dem.tif) to the edges, creating an edges_slope.gpkg file.
- Use BikeNodePlanner
- Run scripts 01 to 04
- Let's call
loopspaththe data/input path to your project, for examplebikenwloops/data/input/funen/ - Copy the file
edges_slope.gpkgfrombike-node-planner/data/output/elevationintoloopspath/network/processed/
├── code <- Jupyter notebooks and py scripts
├── data <- Data (not saved on github)
│ ├── input <- Original, immutable data
│ └── processed <- Modified data
├── parameters <- Parameters and config files
│ └── dataretrieval <- Config files for retrieving data
├── plots <- Generated figures
├── .gitignore <- Files and folders ignored by git
├── .pre-commit-config.yaml <- Pre-commit hooks used
├── LICENSE.txt
├── README.md
└── environment.yml <- Environment file to set up the environment using pixi