mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-09-18 20:05:44 +00:00
Docs: Update benchmark for stealth/union-alpha EFF:high
This commit is contained in:
16
tests/11_geospatial/outputs/stealth_union-alpha EFF_high.js
Normal file
16
tests/11_geospatial/outputs/stealth_union-alpha EFF_high.js
Normal file
@@ -0,0 +1,16 @@
|
||||
async function analyzeGPS(readings, boundary) {
|
||||
const { booleanPointInPolygon, lineString, length } =
|
||||
await import("https://cdn.jsdelivr.net/npm/@turf/turf@7.2.0/+esm");
|
||||
|
||||
const points = readings
|
||||
.filter(({ loc }) => booleanPointInPolygon(loc, boundary, { ignoreBoundary: true }))
|
||||
.sort((a, b) => a.ts - b.ts)
|
||||
.map(({ loc }) => loc);
|
||||
|
||||
return points.length < 2
|
||||
? 0
|
||||
: +length(lineString(points), { units: "kilometers" }).toFixed(2);
|
||||
}
|
||||
export default analyzeGPS;
|
||||
// Generation time: 53.787s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user