feat(firms): export the layer's FRP and Confidence filter (#1822)

The fire layer module exports filterFires and DEFAULT_FIRE_FILTER, the filter its markers use, so an application drawing the same detections another way hides the same fires.
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-18 14:29:57 -08:00
1 parent d6972f8b78
commit edc64bdf9a
3 files changed
+20

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
- The fire layer module exports the FRP and Confidence filter its markers use
(`filterFires`, `DEFAULT_FIRE_FILTER`), so an application that draws the same
detections another way can apply the same filter.
+14
View File
@@ -0,0 +1,14 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { DEFAULT_FIRE_FILTER, filterFires } from './index.js';
test('the fire layer exports the filter its markers use', () => {
const fires = [
{ frp: 2, confidence: 0.3 },
{ frp: 40, confidence: 0.9 },
];
assert.equal(filterFires(fires, DEFAULT_FIRE_FILTER), fires);
assert.deepEqual(filterFires(fires, { minFrp: 10, confidence: 'all' }), [
fires[1],
]);
});
+3
View File
@@ -40,3 +40,6 @@ export { createFirmsSource } from './source.js';
export { createFireAnchors, FIRE_ANCHOR_LIFT_M } from './anchors.js';
export * from '../../data/firmsAdapt.js';
export * from '../../data/firmsLabels.js';
// The layer's own FRP and Confidence filter, for an application drawing the same detections
// another way: what it draws then matches the layer's markers under the same filter.
export { DEFAULT_FIRE_FILTER, filterFires } from '../../data/firmsIntensity.js';