@mytec: iter10.1 ready for testing

This commit is contained in:
2026-01-30 16:34:46 +02:00
parent 55fd42b696
commit d0e827e350
5 changed files with 96 additions and 60 deletions

View File

@@ -57,10 +57,16 @@ export default memo(function CoverageStats({ points, resolution }: CoverageStats
const totalArea = estimateAreaKm2(points.length, resolution);
const total = points.length;
const rsrpValues = points.map((p) => p.rsrp);
const minRSRP = Math.min(...rsrpValues);
const maxRSRP = Math.max(...rsrpValues);
const avgRSRP = rsrpValues.reduce((a, b) => a + b, 0) / total;
// Use reduce instead of Math.min/max spread — spread crashes on 65k+ elements
let minRSRP = Infinity;
let maxRSRP = -Infinity;
let sumRSRP = 0;
for (const p of points) {
if (p.rsrp < minRSRP) minRSRP = p.rsrp;
if (p.rsrp > maxRSRP) maxRSRP = p.rsrp;
sumRSRP += p.rsrp;
}
const avgRSRP = sumRSRP / total;
// Unique sites contributing to coverage
const uniqueSites = new Set(points.map((p) => p.siteId)).size;