Green path server is the routing service of the Green Paths route planner: green-paths.web.app / DigitalGeographyLab/hope-green-path-ui. Its goal is to help people find routes of fresh air, less noise and more greenery for walking and cycling in the Helsinki capital region. Also, it provides means for researchers to study citizens travel-time exposure to environmental qualities and to assess presence of healthier routes in different areas.
The route planner is being developed by Digital Geography Lab, University of Helsinki, currently within the project UIA HOPE – Healthy Outdoor Premises for Everyone funded by Urban Innovative Action. It utilizes the experimental air quality index data, AQI 2.0, from the FMI-ENFUSER modelling system developed by the Finnish Meteorological Institute. AQI 2.0 is based on real-time hourly data as a composite measure of NO2, PM2.5, PM10, O3, black carbon and lung deposit surface area. The route planner applies modelled noise data from road and rail traffic according to the EU Environmental Noise Directive. Street level green view (i.e. greenery) data is derived from analyzing Google Street View images and openly available land cover data by HRI.
Currently implemented features include calculation of unpolluted, green and quiet paths for walking or cycling (separately) with respect to real-time air quality, street level green view index and typical (day-evening-night) traffic noise levels. The exposure-based routing method (and application) is based on an MSc thesis.
- Green paths routing API
- Related projects
- Materials
- Tech
- Installation
- Graph data
- Configuration
- Running the server locally: linux/osx
- Running the server locally: win
- Running the tests
- Links
- Contributing
- License
See docs/green_paths_api.md for documentation of the green paths routing API (endpoints and data types).
- OpenStreetMap
- FMI-Enfuser modeling system
- SYKE - Traffic noise modeling data from Helsinki urban region
- Traffic noise zones in Helsinki 2017
- Street-level green view index by Google Street View images
- Land cover data (low & high vegetation)
- Python 3.8
- igraph
- GeoPandas
- Shapely
- Flask & Gunicorn
$ git clone https://github.com/DigitalGeographyLab/hope-green-path-server.git
$ cd hope-green-path-server/src/env
unix/osx
$ conda env create -f conda-env.yml
Windows
> conda env create -f conda-env-win.yml
To run the server, download one or more of the following graph files to the folder src/graphs
:
- hma.graphml
- hma_r.graphml (for research)
- hma_r_hel-clip.graphml (for research)
The file hma.graphml
covers the extent of the HMA (i.e. Helsinki, Espoo, Vantaa & Kauniainen), whereas kumpula.graphml
is a small subset of the full graph intended for development and testing purposes (it is included in this repository).
To use street network graph data with Green Paths, it needs to be in the GraphML format and feature required node & edge attributes. The format and attributes of the graph data are described in the documentation of the module graph_build.
It is possible to construct a routing graph for any area from raw OpenStreetMap data (*.pbf). However, since data on traffic noise, greenery and air quality may not be available in the same format for other areas, some customized data processing and sampling are likely needed. See the module graph_build for more documentation on graph building.
A number of settings of the routing software can be adjusted from the configuration file: src/gp_server/conf.py. The routing workflow and response schema are described in docs/green_paths_api.md, including the differences in research mode.
$ cd src
$ conda activate gp-env
$ export GRAPH_SUBSET=True
$ gunicorn --workers=1 --bind=0.0.0.0:5000 --log-level=info --timeout 450 gp_server_main:app
# or
$ sh start-gp-server.sh
In order to run the app on Windows, you must serve it with Flask as instructed in this chapter (Gunicorn cannot be installed on Windows).
For testing and development purposes, you can set the graph file as kumpula.graphml
in conf.py
Start the application:
> cd src
> conda activate gp-env
> python gp_server_main.py
Now for example the following request should return some (quiet) paths as GeoJSON: http://localhost:5000/paths/walk/quiet/60.20772,24.96716/60.2037,24.9653
Learn how to use the API by reading the documentation.
$ cd src
$ python -m pytest gp_server/tests_unit -v
$ python -m pytest gp_server/tests_api -v
$ python -m pytest aqi_updater/tests -v
- See also CONTRIBUTING.md
- Please bear in mind that the current objective of the project is to develop a proof-of-concept of a green path route planner rather than a production ready service
- You are most welcome to add feature requests or bug reports in the issue tracker
- When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change (firstname.lastname@helsinki.fi)
- Simple typo fixes etc. can be sent as PRs directly, but for features or more complex bug fixes please add a corresponding issue first for discussion