Skip to content

Read every reference file from Offware's shared data, with worldwide stations - #40

Open
davd-gzl wants to merge 3 commits into
mainfrom
shared-places-dataset
Open

davd-gzl wants to merge 3 commits into
mainfrom
shared-places-dataset

Conversation

@davd-gzl

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

Copy link
Copy Markdown
Collaborator

Before: Postcards built its own reference data from scripts and vendored files: cities, regions, airports, UNESCO sites, European stations, countries and moments. Railway stations covered Europe only (Trainline), and landmarks were a small hand-seeded list.

After: every reference file comes from Offware's shared data (https://github.com/offware-apps/data), the one place all Offware apps read their data from. New users get railway stations worldwide from Wikidata by default, and landmarks are the 10,000 best-known sights. The other files are the same as before, now built there; only the Trainline stations are fresher. Trainline and None stay selectable in Settings.

People who used the app before and never picked a station source keep Trainline, so the station ids already saved in their visits keep matching.

How: scripts/fetch-data.mjs (pnpm data) reads the shared data's catalog.json, then fetches each file. A file is written only while its dataset still carries the licence the app's provenance names, and only when it has the expected shape and enough valid records. Otherwise the committed copy stays, so the app always builds and works offline. The build fails only if there is no worldwide stations file at all.

The Pages and Android workflows run it before the build, and Pages also rebuilds weekly. The worldwide stations file is runtime-cached rather than precached. The build scripts that moved (build-reference, build-railways, build-heritage-full, build-languages, build-sovereignty, build-city-admin1), their vendored sources and their dev dependencies are removed. The two gazetteer checks against the vendored GeoNames day move to the shared data with them. Provenance (Settings, PROVENANCE.md) and the wiki name the shared data. Spec: specs/022-shared-places/.

Merge after offware-apps/data#2, and once https://offware-apps.github.io/data/v1/catalog.json is live: until then the worldwide stations step fails on purpose.

Checks: typecheck and all 702 unit tests pass locally. A run against a local build of offware-apps/data#2 wrote every file. Cities, regions, airports, UNESCO sites, continents and sovereignty came out byte-identical to the committed copies; the rest differ only in formatting or fresher Trainline rows.

Stations now default to Wikidata's railway stations worldwide, fetched at
build time from the Offware places dataset (CC0), instead of Trainline's
European list. People who used the app before keep Trainline unless they
switch in Settings, so their saved station ids stay valid. Landmarks come
from the same dataset: the 10,000 best-known sights, UNESCO sites excluded.
@davd-gzl davd-gzl self-assigned this Oct 12, 2026
The places repository becomes Offware's shared data repository, with one
folder per dataset: stations/railways.json and places/landmarks.json.
@davd-gzl davd-gzl changed the title Worldwide railway stations and landmarks from the shared places dataset Worldwide railway stations and landmarks from Offware's shared data Oct 12, 2026
Cities, regions, airports, UNESCO sites, Trainline stations, languages,
country names, continents, sovereignty and moments are now built in
offware-apps/data. scripts/fetch-data.mjs (pnpm data) fetches them at
build time, taking a file only while its dataset carries the licence
provenance names; otherwise the committed copy stays. The build scripts,
their vendored sources and their dev dependencies leave Postcards, and
the gazetteer checks against the vendored GeoNames day move with them.
@davd-gzl davd-gzl changed the title Worldwide railway stations and landmarks from Offware's shared data Read every reference file from Offware's shared data, with worldwide stations Oct 23, 2026

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