Files
lynchmark/tests/11_geospatial/outputs/x-ai_grok-4.1-fast.js
2025-11-20 01:45:32 +00:00

6 lines
346 B
JavaScript

async function analyzeGPS(readings, boundary) {
const { point: p, booleanPointInPolygon: i, lineString: s, length: l } = await import('https://esm.sh/@turf/turf@6');
const v = readings.filter(r => i(p(r.loc), boundary)).sort((a, b) => a.ts - b.ts);
return v.length < 2 ? 0 : +l(s(v.map(r => r.loc))).toFixed(2);
}
export default analyzeGPS;