prototype.mov
Sustainable Travel Planner helps users compare train and plane carbon emissions and travel duration. The application is built using Streamlit, map and charts are created in Vega-Altair.
Three versions of the sustainable travel planner with different data visualisations were created for user testing:
- Version 1: horizontal bar charts
- Version 2: vertical bar charts
- Version 3: bullet chart and proportion area circles
This tool is part of a Cartography MSc. thesis "Maps for sustainable business travel advice" (Poster, Presentation), conducted by Viktor Kochkin at the ITC, University of Twente.
- Compare carbon emissions and travel duration between train and plane.
- Visualize travel routes on a map.
- Support for round trips and multiple passengers.
- Dynamic updates based on selected cities.
└── sustainable_travel/
├── streamlit_app.py #Streamlit app main script
├── utils.py #Functions for data loading, normalization, and map creation
├── data_gathering.ipynb #Data preparation scripts in jupyter notebook
├── data
│ ├── coordinates.csv #Coordinates of 29 cities for the map
│ └── trips_data.csv #Plane and train travel time and emissions data for 406 city pairs
├── geojson_files
│ ├── lines #Train routes polylines
│ └── points #Train routes transfer points
└── pages # Different prototype versions for user testing
├── ver1.py
├── ver2.py
└── ver3.py
Route planning is limited to 29 European cities:
- Amsterdam- Bern
- Bilbao
- Bratislava
- Brussels
- Bucharest
- Budapest
- Copenhagen
- Dresden
- Istanbul
- Lisbon
- Ljubljana
- London
- Luxembourg City
- Madrid
- Munich
- Oslo
- Paris
- Prague
- Riga
- Rome
- Sofia
- Stockholm
- Tallinn
- Vienna
- Vilnius
- Warsaw
- Zagreb
-
Loading Data:
- The trip and coordinates data are loaded from CSV files into Pandas DataFrames.
- Column names are stripped of any leading or trailing spaces.
-
Normalizing Data:
- City pairs in the trip data are normalized using the
normalize_city_pair
function.
- City pairs in the trip data are normalized using the
-
Creating Maps:
- The base map is created using the
create_base_map
function, which includes city points. - GeoJSON routes are loaded using the
load_geojson_route
function to draw routes on the map.
- The base map is created using the
-
User Interaction:
- Users select departure and destination cities, number of people, and whether the trip is a round trip.
- Travel details are displayed, including duration and CO2 emissions for both train and plane.
- Dynamic charts are created using Vega-Altair to visualize travel duration and CO2 emissions.
-
Dynamic Updates:
- The app dynamically updates the 'To' city options based on the selected 'From' city.
- Travel details and maps are updated based on user input.