mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark for openrouter/bert-nebulon-alpha
This commit is contained in:
16
tests/11_geospatial/outputs/openrouter_bert-nebulon-alpha.js
Normal file
16
tests/11_geospatial/outputs/openrouter_bert-nebulon-alpha.js
Normal file
@@ -0,0 +1,16 @@
|
||||
export const analyzeGPS = async (readings, boundary) => {
|
||||
const { default: turf } = await import('https://unpkg.com/@turf/turf@6/turf.min.js')
|
||||
|
||||
const inside = readings.filter(({ loc }) =>
|
||||
turf.booleanPointInPolygon(turf.point(loc), boundary, { ignoreBoundary: false })
|
||||
)
|
||||
|
||||
if (inside.length < 2) return 0
|
||||
|
||||
const sorted = inside.sort((a, b) => a.ts - b.ts)
|
||||
const line = turf.lineString(sorted.map(({ loc }) => loc))
|
||||
const length = turf.length(line, { units: 'kilometers' })
|
||||
|
||||
return Math.round(length * 100) / 100
|
||||
}
|
||||
export default analyzeGPS;
|
||||
Reference in New Issue
Block a user