mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
feat(perimeters): colour fire perimeters by age
The Fire Perimeters layer now draws a snapshot of fires and the pieces of
their burned area, each piece coloured by its age at the snapshot's moment
(under 6 h, 6-24 h, 1-3 days, older or unknown). Containment stays on the
card; the legend counts fires by last growth and shows the source's note.
- One source method, getSnapshot, returning {at, fetchedAt, stale,
revision, note, fires, pieces}; getSnapshotDetail is removed.
- WFIGS: one piece per polygon, born at poly_PolygonDateTime, else
poly_DateCurrent; a time more than 10 minutes ahead is unknown.
- Outlines are drawn apart from fills, so cut pieces have no line along
the cut; redraws happen only on a new revision or a change of age band.
- The card ages from `at` and adds "last growth ... ago"; a past `at`
links only to InciWeb pages created by then.
- perimeterOptions: { inciweb: false } creates no InciWeb sources.
- get_fire_perimeters filters by pieces, places fires at their anchor and
returns last_growth; analyst items carry lastGrowthTime; spot
conditions use the anchor.
This commit is contained in:
1 parent
d9d79ebc4d
commit
bc77f265a8
48 files changed
+1899
-733
No files matched your search
@@ -896,6 +896,24 @@ test('time fields filter by ISO and derive ageHours; the feed window is exposed'
|
||||
assert.equal(age.coverage.layersQueried[0].window, 'last 24 h');
|
||||
});
|
||||
|
||||
test('perimeter age follows the snapshot time of the remembered rows', async () => {
|
||||
const discoveredTime = Date.UTC(2024, 6, 1);
|
||||
let at = Date.UTC(2024, 6, 2);
|
||||
const engine = createAnalystEngine({
|
||||
now: () => Date.UTC(2026, 6, 2),
|
||||
getRecords: () => [{ id: 'Pine', discoveredTime }],
|
||||
getRecordsAt: () => at,
|
||||
});
|
||||
const first = await engine.query({
|
||||
layers: ['fire-perimeters'],
|
||||
scope: { kind: 'anywhere' },
|
||||
});
|
||||
assert.equal(first.items[0].ageHours, 24);
|
||||
at = null;
|
||||
const followUp = await engine.query({ followUp: true });
|
||||
assert.equal(followUp.items[0].ageHours, 24);
|
||||
});
|
||||
|
||||
test('follow-up provenance stays attached to old rows after a feed recovers', async () => {
|
||||
let state = 'stale';
|
||||
const engine = createAnalystEngine({
|
||||
|
||||
Reference in new issue
Block a user