Python tool to export OpenStreetMap cycle routes as GPX tracks
Cycle routes are stored in OpenStreetMap as relations, which group together a number of ways that define the cycle route. Due to direction of travel restrictions on certain roads, roundabouts for example, cycle routes cannot easily be downloaded as continuous GPX tracks. The aim of this repository is to make a tool which can be used to download continuous GPX tracks for any cycle route contained within OpenStreetMap.
To get started please clone the repository and install dependencies (we recommend using a virtual environment).
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
OpenCycleExport uses a number of sub modules for downloading, processing and exporting of cycle route data.
Query the OverpassAPI using Overpass API python wrapper to download and cache the ways contained within a cycle route relation.
Process a route to compute a ordered list of points which are the best means to travel between two locations.
Utility functions to augment the Shapely library. This allows a collection of LineStrings which make up a cycle route to be processed. LineStrings can be split where other routes join them at a mid point.
Add elevation data and export GPX tracks using gpxpy.
OpenCycleExport is licensed under the GNU GPLv3 license.