No description
On narrow screens the sidebar collapses to a 48px handle strip at the bottom of the screen. Tapping the handle slides the panel up to 65vh, revealing the full stop list and controls. The map takes the full viewport width when the panel is closed or peek-visible. The handle label updates dynamically to show the loaded route name. The panel auto-opens when a route or route_master finishes loading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| homepage | ||
| src/osm_geojson | ||
| tests | ||
| web | ||
| .gitignore | ||
| AGENTS.md | ||
| pyproject.toml | ||
| README.md | ||
openstreetmap-tools
A collection of tools for working with OpenStreetMap public transport data.
Tools
osm-pt-geojson
Fetch an OSM public transport route relation and list its stops, or export the route as GeoJSON.
CLI usage
osm-pt-geojson list-stations <relation_id>
osm-pt-geojson route-between <relation_id> <from_station> <to_station> [-o FILE]
osm-pt-geojson full-route <relation_id> [-o FILE]
List stops on a route:
$ osm-pt-geojson list-stations 18892969
Route: Bus A1: Bristol Airport → Bristol Bus Station
Stops (21):
1. Airport Terminal
2. Airport Tavern
...
21. Bus Station
Export a segment between two stops as GeoJSON:
$ osm-pt-geojson route-between 18892969 "Airport Terminal" "East Street" -o segment.geojson
Export the full route as GeoJSON:
$ osm-pt-geojson full-route 18892969 -o route.geojson
Omit stop points from GeoJSON output:
$ osm-pt-geojson full-route 18892969 --no-stops -o route.geojson
GeoJSON is written to stdout if -o is not given.
Output format
A GeoJSON FeatureCollection containing:
- A
LineStringfeature for the route geometry, withname,ref,from,to, androuteproperties from the OSM relation tags. - A
Pointfeature for each stop, with anameproperty (omitted with--no-stops).
Installation
pip install osm-geojson
Or from source:
git clone https://git.4angle.com/edward/openstreetmap-tools
cd openstreetmap-tools
pip install -e .
Web frontend
An interactive map interface for browsing and downloading public transport routes as GeoJSON.
Features
- Enter a relation ID or OSM URL to load a route onto the map.
- Click stops in the sidebar list or on the map to set start and end points.
- Preview the selected segment highlighted on the map.
- Toggle stop points in/out of the GeoJSON before downloading.
- Download a segment or the full route as a
.geojsonfile. - Entering a
route_masterID shows all directions on the map with links to each individual route. - Bookmarkable URLs:
/<relation_id>loads that route directly.
Running the dev server
pip install -e ".[web]"
flask --app web/app.py run
Open http://127.0.0.1:5000.
API
The web frontend exposes a JSON API. Full documentation is available at /docs
when the server is running.
| Endpoint | Description |
|---|---|
GET /api/route/<id> |
Full route GeoJSON, stop list, and sibling routes |
GET /api/segment/<id>?from=NAME&to=NAME |
Segment between two named stops |
GET /api/route_master/<id> |
All member routes of a route_master |
Licence
MIT License. Copyright (c) 2026 Edward Betts.