Skip to main content

Module geolocation

Module geolocation 

Source
Expand description

W3C Geolocation API with Coordinate Math, OS Provider Bridge, NMEA-0183 / GeoClue2 / GeoIP payload decoders, and Great-Circle Distance Solving.

Structs§

GeoCoordinates
W3C Geographic coordinates.
Geolocation
Thread-safe Geolocation controller.
GeolocationOptions
Options for acquiring geolocation.
GeolocationPosition
A complete W3C Geolocation position snapshot.

Enums§

GeolocationError
Errors occurring during geolocation lookups.
GeolocationSource
Origin source that produced a GeolocationPosition fix.

Functions§

haversine_distance_meters
Calculates great-circle distance between two WGS84 coordinates using the Haversine formula. Returns distance in meters.
initial_bearing_degrees
Calculates the initial bearing (forward azimuth) from coordinate 1 to coordinate 2 in degrees [0, 360).
parse_env_lat_lon
Parses "lat,lon", "lat,lon,alt_m", or "lat,lon,alt_m,accuracy_m" (used for STRATA_GEO_LAT_LON deterministic overrides).
parse_geoclue_dbus_output
Parses gdbus call --method org.freedesktop.DBus.Properties.GetAll or key=value GeoClue2 / XDG Portal Location dictionary payloads into GeoCoordinates.
parse_gpsd_tpv_json
Parses a gpsd JSON TPV report line into GeoCoordinates.
parse_ip_geolocation_json
Parses common HTTPS GeoIP JSON payloads (ipwho.is, ipapi.co, ipinfo.io) into coarse desktop GeoCoordinates.
parse_nmea_sentence
Validates and parses an NMEA-0183 $GPGGA / $GNGGA or $GPRMC / $GNRMC sentence into WGS84 GeoCoordinates.

Type Aliases§

OsGeolocationProvider
Callback signature for process-wide OS geolocation provider hooks (e.g. strata_device).