I used rail and bus timetable data to compute public transport itineraries to the starting point every Munro route on walkhighlands for a few sample days. Itineraries are ranked based on various subjective factors you can customize. The algorithm presumes summer conditions.
Route information from walkhighlands on this site will be outdated, any errors introduced are mine. My goal is to help you find interesting routes to look into further on walkhighlands.co.uk.
Install requirements
- Java
- uv (Python package manager - Install via
curl -LsSf https://astral.sh/uv/install.sh | sh) - R
- renv (Install via
Rscript -e "install.packages('renv', repos='https://cloud.r-project.org/')")
Prepare data
> ./download_streets.sh
> ./download_timetables.sh
> ./otp.sh --build # (Caches street graph, use --buildStreet to rebuild)Munro route starting coordinates were downloaded from walkhighlands (see data_sources/walkhighlands) and checked into this repository, so you should not need to redownload them.
Transit data trimming
The ./download_timetables.sh script automatically trims both bus and rail transit data to the next full week (Monday-Sunday):
- Bus trimming uses a Python script (with uv for dependency management) that filters GTFS with gtfs-kit
- Rail trimming uses UK2GTFS's built-in
gtfs_trim_dates()function in R - Both sources are trimmed to the same week to ensure consistency
./otp.sh --buildextracts the week start date from the trimmed GTFS and writes it tootp/transit_week.txt- The analyzer reads this file to determine which Wed/Sat/Sun dates to query
To update to a newer week, re-run from ./download_timetables.sh onwards. The trimmed transit data represents a fixed week and won't change unless you re-run the workflow.
Analyze data
./otp.sh # Run OpenTransitPlanner in one terminal
./analyzer/analyze.sh # This script will take hours. If interrupted run it again to generate the rest.