# Station data attribution

`uk-stations.json` is a reduced snapshot (CRS code as `id`, station name as `name`) of [davwheat/uk-railway-stations](https://github.com/davwheat/uk-railway-stations), commit `109c6cdc92ae17829d32185161933d80985a93c0`, retrieved 20 September 2026. The source contains 2,608 National Rail stations in Great Britain, not Northern Ireland or every metro/tram network. It is a community-maintained list and can lag openings, closures and renamings.

Credit: David Wheatley, [Trainline EU](https://github.com/trainline-eu/stations) and [its credited sources](https://github.com/trainline-eu/stations#licence). Contains information from [OpenStreetMap contributors](https://www.openstreetmap.org/copyright) and other sources documented by Trainline EU.

This adapted database is offered under the [Open Database License 1.0](https://opendatacommons.org/licenses/odbl/1-0/), also included in `uk-stations-LICENSE.txt`. The downloadable JSON is the complete adapted database. The database licence does not apply to the application's code.

To update: retrieve `stations.csv` from a reviewed upstream commit; select `crsCode` and `stationName`, normalize codes to uppercase, verify unique three-letter CRS codes, sort by name, write `id`/`name` objects, and update the commit/date/count here. No build-time or runtime download is required.

## Station coordinates for custom checks

`uk-station-coordinates.json` adds latitude/longitude for the same 2,608 existing station IDs, from `stations.csv` at the **same pinned commit above**, retrieved 21 September 2026. The original `uk-stations.json` names/codes are unchanged. Coordinates were joined by CRS, checked for unique IDs and GB bounds, and not guessed. Both JSON downloads together are the complete adapted database, under ODbL 1.0 with the credits above. No automatic updates or runtime station discovery API is used.

Nearest-station search uses great-circle distance (Earth mean radius 3958.7613 miles), at most 8 stations within 15 miles, ordered by unrounded distance then station ID. Display distances are rounded to one decimal place. Distances are postcode-centroid to station, not walking/road distances or travel-time estimates. Users select a practical station and supply their own transfer time.

Postcode data: see [location-data.html](./location-data.html) for provider credits and the GB-only postcode licensing scope. The NI restriction is specific to postcode geocoding, not UK event ingestion.
