mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
fix: find cables that cross an area between vertices
Cable searches only tested vertices, so a cable crossing an area with no vertex inside it was missed. Lines now test each segment against the area's bounds, across the antimeridian too, and against a radius area's great-circle distance.
This commit is contained in:
1 parent
5b73b70d19
commit
6f56c84b0b
4 files changed
+201
-5
No files matched your search
@@ -72,6 +72,21 @@ test('cables are found by area and name, with landing points and attribution', a
|
||||
catalog.call('find_submarine_cables', {}),
|
||||
/area, a name or both/,
|
||||
);
|
||||
// Areas a cable crosses between vertices, including at the antimeridian.
|
||||
const atlantic = await catalog.call('find_submarine_cables', {
|
||||
area: { bbox: [-30, 40, -20, 43] },
|
||||
});
|
||||
assert.deepEqual(
|
||||
atlantic.data.rows.map((row) => row.id),
|
||||
['marea'],
|
||||
);
|
||||
const pacific = await catalog.call('find_submarine_cables', {
|
||||
area: { bbox: [179, 34, -179, 35.5] },
|
||||
});
|
||||
assert.deepEqual(
|
||||
pacific.data.rows.map((row) => row.id),
|
||||
['unity'],
|
||||
);
|
||||
});
|
||||
|
||||
test('the local fetch serves bundled data files and nothing outside them', async () => {
|
||||
|
||||
Reference in new issue
Block a user