The code is based on a combination of Python and SQL scripts.
To run the code, first install the required dependencies:
First clone this repository (recommended) to your local machine or download it.
To avoid cloning the history and larger branches with example data and plots, use:
git clone -b main --single-branch [url to GitHub repository] --depth 1Install Postgresql version 14.10 or newer.
See this link for a guide to installing Postgresql with homebrew on Mac.
PgAdmin is not required, but can be useful when inspecting the results: Guide for installing PgAdmin.
Install the Postgresql extensions PostGIS and PgRouting.
If using homebrew, once Postgresql is installed, run:
brew install postgis
brew install pqrouting
To ensure that all packages needed for the analysis are installed, it is recommended to create and activate a new conda environment using the environment.yml:
conda env create --file=environment.yml
conda activate dk_network_analysisIf this fails, the environment can be created by running:
conda config --prepend channels conda-forge
conda create -n dk_network_analysis --strict-channel-priority geopandas seaborn psycopg2 contextily matplotlib-scalebar sqlalchemy geoalchemy2 pyarrow h3-py pyyaml pysal plotly plotly_express==0.4.0 numba rioxarray rasterio scikit-learn ipykernelWhen the environment has been created successfully, run:
pip install kaleido
pip install --upgrade nbformatThe repository has been set up using the structure described in the Good Research Developer. Once the repository has been downloaded, activate the dk_bike_network environment, navigate to the main folder in a terminal window and run the commands:
conda activate dk_bike_network
conda install pip
pip install -e .