Files
lynchmark/tests/11_geospatial/outputs/moonshotai_kimi-k2.6.js
2026-04-21 18:04:18 +00:00

8 lines
455 B
JavaScript

const analyzeGPS = async (readings, boundary) => {
const { booleanPointInPolygon, lineString, length } = await import('https://esm.sh/@turf/turf');
const v = readings.filter(r => booleanPointInPolygon(r.loc, boundary, { ignoreBoundary: true })).sort((a, b) => a.ts - b.ts);
return v.length < 2 ? 0 : +length(lineString(v.map(r => r.loc)), { units: 'kilometers' }).toFixed(2);
};
export default analyzeGPS;
// Generation time: 74.841s
// Result: PASS