Files
lynchmark/tests/11_geospatial/outputs/minimax_minimax-m2.5.js
2026-02-12 16:36:02 +00:00

8 lines
438 B
JavaScript

async function analyzeGPS(readings, boundary) {
const{booleanPointInPolygon,point,lineString,length}=await import('https://cdn.jsdelivr.net/npm/@turf/turf@6/+esm');
const v=readings.filter(r=>booleanPointInPolygon(point(r.loc),boundary)).sort((a,b)=>a.ts-b.ts);
return v.length<2?0:Math.round(length(lineString(v.map(r=>r.loc)),{units:'kilometers'})*100)/100;
}
export default analyzeGPS;
// Generation time: 45.041s
// Result: PASS