us sources

This commit is contained in:
vcoppe committed 2026-12-03 20:25:25 +01:00
1 parent cc97f03e29
commit 4b5b6b8a20
6 files changed
+163 -31

No files matched your search

@@ -137,6 +137,35 @@ describe('planTile', () => {
});
});
it('takes the states of the United States with the same imagery as one', async () => {
const { tiles } = savedTiles();
// Kansas City, in Kansas and Missouri, both from the NAIP
const { parts, fallback } = await planTile(...tile(-94.6075, 39.11, 13), tiles);
assert.deepEqual(
parts.map((part) => part.relation),
['full']
);
assert.equal(fallback, false);
});
it('takes other states from their own agencies', async () => {
const { tiles } = savedTiles();
// Washington DC
assert.deepEqual(await plan(tile(-77.036, 38.897, 16), tiles), {
parts: ['US-DC:full'],
fallback: false,
});
// Portland, and the Columbia, with Washington, which is not in the patchwork, to the north
assert.deepEqual(await plan(tile(-122.68, 45.59, 16), tiles), {
parts: ['US-OR:full'],
fallback: false,
});
assert.deepEqual(await plan([13, 1305, 2927], tiles), {
parts: ['US-OR:partial'],
fallback: true,
});
});
it('asks for a tile of the countries once for all the tiles of imagery inside it', async () => {
const { asked, tiles } = savedTiles();
// around Lausanne, which no other test asks for