Great-circle distance between two points, in KILOMETRES.
⚠️ This is the only distance function in the repo that does NOT return metres —
utils/geo/haversine.haversineDistance() and the filter helpers all return metres.
The two families share the same scalar signature (lat1, lng1, lat2, lng2) => number,
so TypeScript cannot tell them apart: substituting one for the other type-checks
cleanly and shifts every comparison by a factor of 1000. That is exactly what happened
in route-filter until KERNEL S11. Convert explicitly at the call site, as
plugin-addpoi/poi-placement.ts does (snapTolerance / 1000).
Kept in kilometres because it is published as GeoLeaf.Utils.getDistance.
Great-circle distance between two points, in KILOMETRES.
⚠️ This is the only distance function in the repo that does NOT return metres —
utils/geo/haversine.haversineDistance()and the filter helpers all return metres. The two families share the same scalar signature(lat1, lng1, lat2, lng2) => number, so TypeScript cannot tell them apart: substituting one for the other type-checks cleanly and shifts every comparison by a factor of 1000. That is exactly what happened inroute-filteruntil KERNEL S11. Convert explicitly at the call site, asplugin-addpoi/poi-placement.tsdoes (snapTolerance / 1000).Kept in kilometres because it is published as
GeoLeaf.Utils.getDistance.