mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(firms): reject missing and out-of-range detection coordinates
This commit is contained in:
1 parent
0265ad4c19
commit
8b68ff8412
5 files changed
+58
-2
No files matched your search
+12
-1
@@ -21,7 +21,18 @@ export function adaptFirmsRecords(records) {
|
||||
for (const record of records) {
|
||||
const lat = Number(record?.lat);
|
||||
const lon = Number(record?.lon);
|
||||
if (!Number.isFinite(lat) || !Number.isFinite(lon)) continue;
|
||||
if (
|
||||
![record?.lat, record?.lon].every(
|
||||
(value) =>
|
||||
typeof value === 'number' ||
|
||||
(typeof value === 'string' && value.trim() !== ''),
|
||||
) ||
|
||||
!Number.isFinite(lat) ||
|
||||
!Number.isFinite(lon) ||
|
||||
Math.abs(lat) > 90 ||
|
||||
Math.abs(lon) > 180
|
||||
)
|
||||
continue;
|
||||
fires.push({
|
||||
index: fires.length,
|
||||
lat,
|
||||
|
||||
Reference in new issue
Block a user