mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 19:21:01 +00:00
12 lines
410 B
JavaScript
12 lines
410 B
JavaScript
const analyzeGPS = async (r, b) => {
|
|
const t = await import('https://cdn.jsdelivr.net/npm/@turf/turf/+esm');
|
|
|
|
const v = r
|
|
.filter(p => t.booleanPointInPolygon(t.point(p.loc), b, { ignoreBoundary: true }))
|
|
.sort((x, y) => x.ts - y.ts);
|
|
|
|
return v.length < 2 ? 0 : +t.length(t.lineString(v.map(p => p.loc))).toFixed(2);
|
|
};
|
|
export default analyzeGPS;
|
|
// Generation time: 23.653s
|
|
// Result: PASS
|