This Python script processes .gpx track files to analyze and visualize travel speeds, compare them against a configurable maximum speed (vmax), and calculate how much longer a trip would take if that speed limit were strictly followed.
- Parses all
.gpxfiles in adata/folder - Crops the track to a configurable bounding box (optional)
- Computes actual speeds between GPS points
- Identifies segments exceeding
vmaxand calculates the extra travel time required to obey the limit - Generates optional plots:
- Original vs adjusted speed traces
- Highlights segments exceeding
vmax
- Summarizes delays per file and overall
Create a virtual environment and install the requirements:
python -m venv venv
source venv/bin/activate # or venv\\Scripts\\activate on Windows
pip install -r requirements.txtRund the script by executing the main file: python main.py
The data contained in the repository are recordings from bus rides in Schinznach-Dorf, Switzerland. They were recorded ahead of a public vote on the introduction of a 30 kph zone that affects the local commuter bus.