Skip to content

Link each station to its town or city for guides and sights - #12

Open
davd-gzl wants to merge 2 commits into
mainfrom
station-places
Open

davd-gzl wants to merge 2 commits into
mainfrom
station-places

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Before: the API only knew station names, so an app had no way to show what to see where a train stops.

After: a new v1/places.json maps every station to its town or city in Offware's shared data repository (https://github.com/offware-apps/data). An app reads a station's place id there and fetches that place's free guide links (Wikivoyage, Wikipedia) and sights from the shared data. The places themselves stay there, built from Wikidata (CC0); this API only holds the link, with the data's licence and attribution copied in.

How: npm run build:places runs after build:api, reads places/index.json from the shared data and matches each station by name: the place whose name the station name starts with, word for word ("LYON PART DIEU" → Lyon, "ST ETIENNE" → Saint-Étienne). The longest name wins, then a place in the operator's own country, then the largest. Places outside Europe never match. If the shared data can't be read, the file is left out and the timetables still publish. Documented in docs/developers.md, docs/format.md and docs/openapi.yaml; CI builds it from a fixture index.

The live file appears once the shared data is published at https://offware-apps.github.io/data/v1/.

places.json maps every station to a place of the Offware places dataset
(Wikidata, CC0), so an app can show a station's guides and sights. The
places themselves stay in that dataset; this API only holds the link.
When the dataset can't be read, the timetables still publish without it.
@davd-gzl davd-gzl self-assigned this Oct 12, 2026
The places repository is now offware-apps/data, with the index at
places/index.json; place files keep their places/<id>.json path.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant