mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
fix(street-level): deduplicate overlapping dateline tile halves
This commit is contained in:
1 parent
6dd4d0156f
commit
ba58a5ec50
4 files changed
+28
-1
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { tilesForBbox } from './tileMath.js';
|
||||
test('coarse dateline coverage counts each tile exactly once', () => {
|
||||
for (const z of [0, 1, 2]) {
|
||||
const result = tilesForBbox([170, -1, -170, 1], z);
|
||||
const keys = result.tiles.map((t) => `${t.x}/${t.y}/${t.z}`);
|
||||
assert.equal(new Set(keys).size, keys.length);
|
||||
assert.equal(result.total, keys.length);
|
||||
const limited = tilesForBbox([170, -1, -170, 1], z, { limit: 1 });
|
||||
assert.equal(limited.total, keys.length);
|
||||
assert.equal(limited.truncated, keys.length > 1);
|
||||
assert.equal(limited.tiles.length, 1);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user