LocationToGpsReading

Translates android.location.Location → engine GpsReading.

Sentinel translation: Android exposes "field unavailable" as either hasX() == false (bearing, altitude, speed, etc.) or as a special value (negative accuracy on some sources). Translate these to null once here, so engine code can trust that a non-null value is real.

Version gates: minSdk for this module is 26, so hasBearingAccuracy, hasVerticalAccuracy, hasSpeedAccuracy are unconditionally available. Newer fields (29+/31+/34+) are runtime-checked.

Cross-platform note: Android's getAltitude is the WGS84 ellipsoid altitude, while iOS's CLLocation.altitude defaults to mean-sea-level. The translator populates ellipsoidAltitude from getAltitude(); mslAltitude is only set on Android API 34+ via getMslAltitudeMeters().

iOS has its own translator (in the iOS SDK repo). GpsReading is the cross-platform contract.

Functions

Link copied to clipboard
open fun convert(@NonNull loc: Location): GpsReading
Convert with FULL accuracy authorization.
open fun convert(@NonNull loc: Location, @NonNull auth: AccuracyAuthorization): GpsReading
Convert with explicit accuracy-authorization state.