Healthy Routes Demo
Introduction
This project is a visual demo of an experiment conducted on pedestrian routes in the city of Valencia, with the goal of optimizing routes by considering pollution caused by traffic. It also visualises real‑time sensor data (traffic flow, air quality) and pollution heatmaps. Intended as a research/demo repository — not production hardened.
The demo is based on the research presented in the paper:
"Optimizing Pedestrian Paths to Minimize Exposure to Urban Pollution Through Traffic Data Analysis".
Interoperability
This demo adheres to Level 1 interoperability as defined by CitCom's interoperability guidelines. It is designed to consume data that conforms to the Smart Data Models specifications, specifically the AirQualityObserved and TrafficFlowObserved models.
Note: This demo has been tailored specifically for the city of Valencia. While it leverages the Smart Data Models specification, there are minor adaptations:
- For
AirQualityObservedentities, pollutant field names are customized. To ensure correct visualization, set the.envvariableAIRQUALITY_POLLUTANT_FIELDto match the desired pollutant field. This allows you to select which pollutant is displayed on the map.- For
TrafficFlowObservedentities, thelocationattribute is not directly available. Sensor locations are instead referenced from an external.csvfile.These adjustments enable the demo to work seamlessly with Valencia's available datasets while maintaining compatibility with Smart Data Models where possible.
Features
- Map UI with route selection between monuments
- Compute fastest route and alternatives
- Show traffic & air quality sensors (including realtime endpoints)
- Pollution heatmap from precomputed or realtime estimations
- Utilities for spatial queries, kriging interpolation and scoring routes
Requirements
- Dependencies listed in
requirements.txt
Installation
-
Clone the repo:
-
Create the virtual environment:
If you don't have the .venv virtual environment, you can create it using the following command:
-
Activate the virtual environment:
-
On Windows:
* On macOS/Linux:
-
-
Install dependencies:
Once the virtual environment is activated, install the required dependencies:
Running the Application
-
Make sure the virtual environment is activated.
-
Run the Flask server with the following command:
-
The server will start, and you should see the following output:
-
To view the web interface, open your browser and go to: http://127.0.0.1:5000
