Skip to content

Publish the rest of Postcards' reference data - #2

Merged
davd-gzl merged 2 commits into
mainfrom
shared-reference
Oct 23, 2026
Merged

davd-gzl merged 2 commits into
mainfrom
shared-reference

Conversation

@davd-gzl

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

Copy link
Copy Markdown
Contributor

Before: this repository published only Wikidata's places and stations. Postcards still built its cities, regions, airports, UNESCO sites, European stations, countries and moments itself, from scripts and vendored files in its own repository.

After: all of them are published here too, each as its own dataset under v1/, listed in catalog.json with its licence, sources and record count. The files are identical to the ones Postcards bundles today. The only difference is that the Trainline stations are read fresh (44,303 now, against 44,283 in Postcards' July copy).

Each dataset keeps its sources' licence. A share-alike source makes the dataset share-alike: regions, airports, countries and European stations are ODbL, and UNESCO sites are CC BY-SA 3.0 IGO. Cities are CC BY 4.0. Places and stations stay CC0. sources.json now gives the credit each licence asks an app to show.

How: one module per source in src/reference/, ported from Postcards' build-reference.mjs, build-railways.mjs, build-heritage-full.mjs, build-languages.mjs and build-sovereignty.mjs. The vendored GeoNames and UNESCO files and the moments list move to data/reference/, along with the script that vendors the GeoNames codes (npm run city-admin1) and the checks that each city and region matches that GeoNames day. npm run build builds them alongside the Wikidata datasets. If Trainline can't be reached, European stations are left out of that build rather than failing it, and --offline skips them. Sources move to src/sources.ts, and the README and AGENTS.md now describe per-dataset licences.

Dataset Files Licence
stations-europe stations-europe/railways.json ODbL 1.0 (Trainline)
cities cities/top.json, cities/all.json CC BY 4.0 (GeoNames)
regions regions/regions.json ODbL 1.0 (GeoNames + dr5hn)
airports airports/airports.json ODbL 1.0 (OpenFlights)
heritage heritage/unesco.json CC BY-SA 3.0 IGO (UNESCO)
countries countries/{names,article-names,continents,languages,sovereignty}.json ODbL 1.0 (world-countries)
moments moments/moments.json per item, as cited

Cities, regions, airports, UNESCO sites, European stations (Trainline),
countries and moments move from Postcards' build scripts into
src/reference/, each its own dataset under v1/ with the licence of its
sources: share-alike sources (ODbL, CC BY-SA) keep their licence, and
sources.json gives the credit each one asks for. The output is the same
as the files Postcards bundles today.
The checks that each city carries GeoNames' current region code and each
region GeoNames' name move here from Postcards, with the script that
vendors the codes (npm run city-admin1).
@davd-gzl
davd-gzl merged commit 4a7f726 into main Oct 23, 2026
2 checks passed
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