Skip to content

Latest commit

 

History

History
92 lines (54 loc) · 3.21 KB

File metadata and controls

92 lines (54 loc) · 3.21 KB

Installation

The code is based on a combination of Python and SQL scripts.

To run the code, first install the required dependencies:

1. Clone the GitHub repository

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 1

2. Install Postgresql

Install 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.

3. Install PostGIS and PgRouting

Install the Postgresql extensions PostGIS and PgRouting.

If using homebrew, once Postgresql is installed, run:

brew install postgis

brew install pqrouting

3. Create conda environment

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_analysis

If 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 ipykernel

When the environment has been created successfully, run:

pip install kaleido
pip install --upgrade nbformat

4. Install src package

The 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 .