Update: 2026-07-06 17:51:16

This commit is contained in:
Hamza-Ayed
2026-07-06 17:51:16 +03:00
parent e21e1f4ec2
commit 9d257c5d7d
8 changed files with 292 additions and 241 deletions
+3 -1
View File
@@ -55,6 +55,7 @@ export function analyzeByZone(samples: RideSample[]): ZoneAnalysis[] {
/**
* Analyze pricing by zone type (centre, mid, suburb, outskirts).
* Passes countryCode to classifyZoneType so the correct city center is used.
*/
export function analyzeByZoneType(
samples: RideSample[]
@@ -62,7 +63,8 @@ export function analyzeByZoneType(
const typeMap = new Map<string, number[]>();
for (const s of samples) {
const zoneType = classifyZoneType(s.startLat, s.startLng);
// Pass countryCode so we use the correct city center (not always Amman)
const zoneType = classifyZoneType(s.startLat, s.startLng, s.countryCode);
if (!typeMap.has(zoneType)) typeMap.set(zoneType, []);
typeMap.get(zoneType)!.push(s.ppk);
}