ip-devicer
    Preparing search index...

    Function detectImpossibleTravel

    • Detect whether two geolocated events imply travel faster than the allowed threshold.

      When both timestamps are identical, any non-zero distance is treated as impossible travel because no elapsed time is available to justify movement.

      Parameters

      • current: { lat: number; lon: number; ts: Date }

        Current observation with coordinates and timestamp.

      • last: { lat: number; lon: number; ts: Date }

        Previous observation with coordinates and timestamp.

      • thresholdKmh: number

        Maximum plausible travel speed in kilometers per hour.

      Returns boolean