Draw Data Library coverage outlines from the bundled Natural Earth countries

Imagery outlines fetched Natural Earth's 1:50m countries (about 3 MB)
from the natural-earth-vector repository's master branch on GitHub at
run time: a moving, rate-limited source whose failures silently removed
the outlines. Core already ships the pinned 1:10m countries pack, so
the outlines now read that, once, the first time an outline needs it.
This commit is contained in:
Sameh Khamis committed 2026-11-12 16:02:07 -08:00
1 parent 8d90cac7dc
commit 9e57fd84c8
3 files changed
+55 -25

No files matched your search

+22
View File
@@ -68,3 +68,25 @@ test('a bbox outline is the coverage rectangle, with no border file needed', ()
],
]);
});
test('outlines come from the bundled Natural Earth countries, closed and in coverage', async () => {
const { loadCountryOutlines, resetCountryOutlines } = await import(
'./outlines.js'
);
resetCountryOutlines();
const countries = await loadCountryOutlines();
for (const id of ['ign-orthophotos-france', 'ee-maa-amet-ortofoto']) {
const entry = libraryEntry(id);
const rings = outlineRings(countries, entry);
assert.ok(rings.length > 0, id);
for (const ring of rings) assert.deepEqual(ring.at(-1), ring[0]);
}
// A pack that cannot load is retried on the next call.
resetCountryOutlines();
await assert.rejects(
loadCountryOutlines(async () => {
throw new Error('unreadable');
}),
);
assert.ok((await loadCountryOutlines()).length > 200);
});