This repository contains a Python script to generate HTML starting from a folder of GPX files. The result is an interactive overview map, containing all gpx routes and a table with links to detailed overviews per route plus a download button for the GPX files.
The detail page per route shows a map with the route and a height profile showing the altitude and climbs along the route.
The climbs are detected using scipy's find_peak algorithm.
The GPX files must be stored in the data/gpx folder.
All files matching data/gpx/*.gpx will appear on the front page index.html.
The GPX files must comply to the following template: r"^DR\s[N|E|W|C|S]{1,2}\s[\w\s]+\.gpx$"
This project was derived from the minimal python boilerplate. The template project contains the following setup ready for you to go:
- package/environment management
poetry
- code validation
black
ruff
pytest
- pre-commit hooks
- Clone this repo
- Make sure to install Poetry
- In your project directory run
poetry shell
poetry install
pre-commit install
- On each
git commit
the code validation packages will be run before the actual commit. - Add your GPX files to the data/gpx folder
- Run
python generate_html_from_gpx.py
to generate index.html and content of data/html - Goto Pages in Settings to make this a Github Pages repository.
- Browse to
https://<username>.github.io/<repository>
. E.g. https://cast42.github.io/leuvengpx/
From the root of this project, add the gpx file "DR C new.gpx" to the data/gpx directory, generate the new version of the site by running the python script and check-in the new files into the version control:
cp DR\ C\ new.gpx data/gpx
- `poetry shell``
- In src/generate_html_from_gpx.py , chance the constant GPX_FILE_TO_HIGHLIGHT to the filename of new gpx file
python src/generate_html_from_gpx.py
git commit -a -m "added DR C new.gpx"
git push