Add API docs page and update README/AGENTS
- Add /docs route serving web/templates/api.html: full Bootstrap 5 documentation page covering all three API endpoints with parameter tables, example requests, and example responses - Add 'API docs' link to the navbar on the main map page - Update README.md: add web frontend section with feature list, dev server instructions, and API endpoint summary table - Update AGENTS.md: add web/ layout, API endpoint table, Flask run instructions, and route_master example relation IDs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e0ade9e5ab
commit
3223d4b063
5 changed files with 361 additions and 7 deletions
44
README.md
44
README.md
|
|
@ -1,6 +1,6 @@
|
|||
# openstreetmap-tools
|
||||
|
||||
A collection of command-line tools for working with OpenStreetMap data.
|
||||
A collection of tools for working with OpenStreetMap public transport data.
|
||||
|
||||
## Tools
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ A collection of command-line tools for working with OpenStreetMap data.
|
|||
Fetch an OSM public transport route relation and list its stops, or export the
|
||||
route as GeoJSON.
|
||||
|
||||
#### Usage
|
||||
#### CLI usage
|
||||
|
||||
```
|
||||
osm-pt-geojson list-stations <relation_id>
|
||||
|
|
@ -67,6 +67,46 @@ 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 `.geojson` file.
|
||||
- Entering a `route_master` ID shows all directions on the map with links to
|
||||
each individual route.
|
||||
- Bookmarkable URLs: `/<relation_id>` loads that route directly.
|
||||
|
||||
#### Running the dev server
|
||||
|
||||
```
|
||||
cd web
|
||||
flask --app 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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue