mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
fix(recent-imagery): take the short arc when a box is dragged across the dateline
A drag across ±180° was turned into a min/max box about 360° wide and refused as "Box is 38,332 km wide", and validateBox() refused any west > east box. A drag whose corners are more than 180° apart is now the short box (west > east), and the layer handles it end to end: - model: lonSpanDeg() and nonCrossingBoxes(); validateBox, boxSideKm, boxCentre, boxFromPin and coverageFor read a west > east box as the short arc. - catalog: CMR reads a west > east bounding_box as the short box, so the box is sent as it is. - rendering: the slot drapes one imagery layer per side of ±180°. - Worldview Snapshots rejects a west > east BBOX, so snapshot URLs, EXPORT and get_recent_imagery refuse a dateline box and request nothing; thumbnail and Data-Present probes use the box's wider side.
This commit is contained in:
1 parent
7df581765d
commit
ca14954636
16 files changed
+503
-70
No files matched your search
@@ -1395,3 +1395,18 @@ test('a voice search cancelled mid-flight says so instead of looking empty', asy
|
||||
assert.equal(f.snap().searching, false);
|
||||
assert.equal(f.snap().notice, 'Search cancelled');
|
||||
});
|
||||
|
||||
test('a box dragged across the dateline is searched, listed and draped as one box', async () => {
|
||||
const f = fixture();
|
||||
const box = { west: 179.8, south: 10, east: -179.8, north: 10.4 };
|
||||
f.layer.enable();
|
||||
assert.equal(f.layer.setBox(box), true);
|
||||
assert.equal(f.snap().boxError, null);
|
||||
assert.deepEqual(f.catalog.searches.at(-1).request.box, box);
|
||||
f.catalog.resolveLast();
|
||||
await settle();
|
||||
assert.equal(f.snap().candidates.length, 4);
|
||||
assert.equal(f.snap().preview.key, S18);
|
||||
assert.equal(f.drapes().a, `${S18}|none`, 'the crossing box is draped');
|
||||
assert.equal(f.snap().boxSizeKm.width < 100, true, 'the short arc, not 360°');
|
||||
});
|
||||
Reference in new issue
Block a user