⚠️ Warning: This repository is currently under construction. Some features may be incomplete or not functioning. Data is not yet included. Repository will be ready for the reproducibility review.
This repository includes the code and instructions for the paper Towards Green Cities: Analysis of the Impact of Bus-Priority Lanes and Accessibility Indicators on Emission Control for Highly Congested Metropolitan Areas During Peak Times
for the for the 28th AGILE conference, Geographic Information Science responding to Global Challenges.
- Python: ≥ 3.10
- Poetry: ≥ 1.5
- R: ≥ 4.0
This project uses Poetry for packaging and dependencies management. Please make sure it is installed on your system.
To set up the project and install all dependencies specified in the pyproject.toml
file, use the following command:
poetry install
Activate the environment:
poetry shell
Please follow the instructions provided here by the official OpenRouteService(ORS) website. We are going to run docker with docker compose (section "Running prebuilt images").
Once you have successfully installed docker and runned docker compose, we will modify the docker compose file to begin with our analysis.
Look for your docker-compose.yml file and open it. Now you will paste our modified docker compose file into the docker compose file that you have pulled.
Depending on which city you want to start with, you need to download the pbf file for London or Lima. Copy the downloaded file into the docker directory and modify the name in line 51 of our docker file. The docker compose file will create the car and walking profiles. This may take some time, but it will be easier to create the isochrones for one country. The docker server will be exposed on port 8081.
Once all is set, run
docker compose up -d
again.
First, we need to run the R Markdown preprocess_files.Rmd. Paste the files "atu_stops.gpkg" and "final_shapes.gpkg" into the make_gtfs_data folder.
This will create all the required files that we need for the next script.
To create the GTFS File for Lima, we are using the Python package make_gtfs. Since the latest version of the package has some issues, we need to download this version. Download the source code, extract the zip and copy the folder into the make_gtfs_data folder. Once you have copied the folder, you can run the GTFS notebook that is within make_gtfs_data folder. This notebook will import the make_gtfs package, load the required GTFS data and create a GTFS feed.
Download the data for running this workflow for Lima and London here and copy the directory as data
into the repository.
To create the lanes.txt files that are required in Network Creation, the .ipynb files must first be executed in the data_preprocessing directory. First, the bus routes need to be clipped to get the geometry of the path between two stops in a sequence with get_route_geometry_between_stops.ipynb. After that, the routes need to be connected with OSM data in order to create the lanes.txt files, that are needed for the network creation. Run the script in get_lanes_info.ipynb, rename the resulting file to a .txt file and add it in the respective GTFS directory.
To run the analysis, you have to first run the following commands. As they take a lot of resources and time, we recommend to use
a processing server for the calculation, especially for London. To switch between the study areas switch the config_path
variable in each file to point to the respective directory (default is lima
).
cd busability
python create_graphs.py
python get_reachable_nodes_isochrones.py
python get_poi_ratio.py