Crates.io | gnss-rs |
lib.rs | gnss-rs |
version | 2.5.0 |
created_at | 2023-10-11 09:41:02.627056+00 |
updated_at | 2025-09-13 13:35:46.848473+00 |
description | GNSS constellations |
homepage | https://github.com/nav-solutions |
repository | https://github.com/nav-solutions/gnss |
max_upload_size | |
id | 1000027 |
size | 86,388 |
High level definitions to work with GNSS in Rust
SV
Constellation
Constellation.timescale()
Add "gnss" to your Cargo.toml
gnss-rs = "2"
Import "gnss-rs":
extern crate gnss_rs as gnss;
A small library to define and handle satellite vehicles and constellation.
use gnss_rs::sv;
use gnss_rs::prelude::*;
use std::str::FromStr;
use hifitime::{TimeScale, Epoch};
// This method lets you construct satellites that may not exist
let sv = SV::new(Constellation::GPS, 1);
assert_eq!(sv.constellation, Constellation::GPS);
assert_eq!(sv.prn, 1);
assert_eq!(sv.launch_date(), None); // only for SBAS vehicles
The library integrates a smart SBAS constellation identifier. We use the RINEX convention (PRN ranging from 0..100), therefore the true satellite number of SBAS vehicles is the PRN we use +100.
use gnss_rs::sv;
use gnss_rs::prelude::*;
use std::str::FromStr;
use hifitime::{TimeScale, Epoch, MonthName};
// This only works if satellite do exist in our database
assert!(SV::new_sbas(1).is_none());
let egnos_geo23 = SV::new_sbas(23)
.unwrap(); // GEO #123
assert_eq!(egnos_geo23.prn, 23);
assert!(egnos_geo23.constellation.is_sbas()); // obviously
assert_eq!(egnos_geo23.constellation, Constellation::EGNOS); // smart builder
let launch_date = egnos_geo23.launch_date()
.unwrap(); // only for detailed SBAS
assert_eq!(launch_date.year(), 2021);
assert_eq!(launch_date.month_name(), MonthName::November);
Other definitions and features exist. Use compilation options (crate features) to unlock them. The idea is to maintain a very minimal default library.
The SERDE features unlocks serialization/deserialization of the main structures defined here.
The DOMES features unlocks the definition of DOMES GNSS/IGS reference station, that are widely used in GNSS data processing. This number identifies a station uniquely.
The COSPAR features unlocks the definition of the COSPAR (Launch) ID number. This number identifies the launch of a vehicule uniquely. It is used in RINEX and other files format.
The SBAS feature will create a static database that defines each SBAS service areas, projected on ground as WKT/GEO objects, with one method to select a SBAS service based on Latitude and Longitude coordinates.
Many libraries exist nowadays to process GNSS data or perform typical GNSS processing tasks.
Amongst them, be sure to checkout:
This library is part of the NAV-Solutions framework which is licensed under Mozilla V2 Public license.