mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
fix(cctv): keep missing numbers unknown instead of reading them as zero
Number() reads null, blank strings and booleans as 0 (or 1), and /api/cctv/sources sends an unknown number as JSON null. A source-pack camera that left out its pose therefore reached the browser as zeros clamped to each field's floor (north, pitch -2, FOV 20, range 120 m, mount 6 m, ground 0 m) instead of taking the defaults, and a null or blank position put the camera at 0,0. toFiniteNumber (server) and safeNumber (browser) now return the fallback for absent, blank and boolean values, as validateBox already does for Recent Imagery. The same conversion fixes the per-pack paths: a Tallinn row with a null heading no longer reads as a high-confidence north-facing camera, a Caltrans camera with a blank elevation keeps its 150 m ground prior, and TfL or Catalonia cameras with a null or blank coordinate are dropped instead of kept at 0,0 or on the zero meridian.
This commit is contained in:
6 files changed
+299
No files matched your search
@@ -117,6 +117,7 @@
|
||||
"server/providers/cctv/constants.js",
|
||||
"server/providers/cctv/media.js",
|
||||
"server/providers/cctv/normalize.js",
|
||||
"src/data/cctvMissingNumbers.test.mjs",
|
||||
"server/providers/cctv/sources.js",
|
||||
"server/providers/radio.js",
|
||||
"server/providers/radio/catalog.js",
|
||||
|
||||
Reference in new issue
Block a user