Expand description
LDM constants — ITS-AID values, epoch offset and spatial helpers.
Mirrors the constant definitions spread across
flexstack/facilities/local_dynamic_map/ in the Python reference.
§Haversine fix
The Python reference implementation computed spatial distances using raw
ETSI integer values (tenths-of-microdegrees) without unit conversion,
producing meaningless metre-scale thresholds that were actually in the
~1e7 range. The haversine_m function here converts both coordinates to
degrees first, then applies the standard Haversine formula over the WGS-84
sphere, giving correct distances in metres.
Constants§
- EARTH_
RADIUS_ M - Earth mean radius in metres (WGS-84 approximation used for Haversine).
- ITS_
AID_ CAM - ITS_
AID_ CRL - ITS_
AID_ CRT - ITS_
AID_ DENM - ITS-S application identifiers (ETSI TS 102 965).
- ITS_
AID_ EEBL - ITS_
AID_ GNSS - ITS_
AID_ GPC - ITS_
AID_ IMZM - ITS_
AID_ IVI - ITS_
AID_ PAM - ITS_
AID_ POI - ITS_
AID_ SAEM - ITS_
AID_ SRM - ITS_
AID_ SSM - ITS_
AID_ TLC - ITS_
AID_ TPG - ITS_
AID_ VAM - ITS_
EPOCH_ MS - Milliseconds between UNIX epoch (1970-01-01) and the ITS epoch (2004-01-01).
Used to convert
std::time::SystemTimeto ITS milliseconds. - MAINTENANCE_
MAX_ ALT_ DIFF_ CM - Maximum altitude difference (in cm) between an LDM record and the local
station before the record is considered out-of-area for GC purposes.
(Python reference had
15, which was in incorrect units.)
Functions§
- haversine_
m - Compute the great-circle distance in metres between two positions given as ETSI integer coordinates (tenths of microdegrees, i.e. × 10⁻⁷ degrees).
- its_
ms_ to_ unix_ ms - Convert an ETSI timestamp (milliseconds since ITS epoch) to milliseconds since UNIX epoch.
- now_
its_ ms - Return the current time as milliseconds since the ITS epoch (2004-01-01).
Panics on platforms where
SystemTime::now()is before the UNIX epoch (should never happen in practice).