Skip to content

Keep UNESCO sites' points through the refresh - #5

Merged
davd-gzl merged 1 commit into
mainfrom
unesco-coordinates
Nov 1, 2026
Merged

davd-gzl merged 1 commit into
mainfrom
unesco-coordinates

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Before: since the first source refresh (25 October), every UNESCO site in the build sits at 0, 0, which apps read as "no coordinates". UNESCO's export now gives a site's points as a GeoJSON MultiPoint and its countries as a list, and the build only read the old { lat, lon } shape.

After: 1,270 of the 1,272 sites have a point again. The other two, the Routes of Santiago de Compostela in France and the First World War funerary sites, have no point in UNESCO's data.

How:

  • The refresh saves each site in the shape the build reads, { lat, lon } and "FR,ES". A site of several parts takes the part nearest their middle, so its point is always one of its own parts.
  • The build reads both shapes, and a refresh whose new shape would lose more than 5% of the points keeps the saved copy, like a shrinking download does.
  • The saved copy is rewritten in that shape from the same download, with no new request to UNESCO.

For single-place sites, the points moved by less than a few kilometres compared with the old copy. Sites of several parts can now point at a different part than before.

UNESCO's export now gives each site's points as a GeoJSON MultiPoint and its
countries as a list, which the build didn't read, so the first refresh left
every site at 0, 0. The refresh now saves both in the shape the build reads,
taking the part nearest the middle of a site of several, and keeps the saved
copy when a new shape would lose the points. The saved copy is rewritten in
that shape.
@davd-gzl
davd-gzl merged commit 8623adb into main Nov 1, 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