GeoLeaf Core API - v3.0.0
    Preparing search index...
    • 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.

      Parameters

      • lat1: number

        Latitude of the first point, decimal degrees.

      • lng1: number

        Longitude of the first point, decimal degrees.

      • lat2: number

        Latitude of the second point, decimal degrees.

      • lng2: number

        Longitude of the second point, decimal degrees.

      Returns number

      The distance in kilometres.