Expand description
Earth figure, points with height, Earth-centred Cartesian coordinates.
A Position is latitude and longitude only (the chart view used by the
sailings). Adding height raises “above what?”, and adding a Cartesian frame
raises “on which ellipsoid?”. Both are explicit here: a Height carries
its VerticalDatum, a GeodeticPoint is a position with such a height,
and an EcefPoint is reached only through a named Ellipsoid.
A Position is on WGS 84 by definition. A position from an older chart is
on that chart’s Datum and may be hundreds of metres off;
Datum::to_wgs84 and Datum::from_wgs84 make the shift explicit via a
Helmert transformation.
use kinavis_kernel::geodesy::{EcefPoint, Ellipsoid, GeodeticPoint, Height};
use kinavis_kernel::{Distance, Position};
let here: Position = "50°45.3'N 001°20.0'W".parse()?;
let point = GeodeticPoint::new(here, Height::above_ellipsoid(Distance::from_metres(48.0)?));
let ecef = EcefPoint::from_geodetic(point, &Ellipsoid::WGS84)?;
let back = ecef.to_geodetic(&Ellipsoid::WGS84)?;
assert!((back.position().latitude().degrees() - here.latitude().degrees()).abs() < 1e-9);
assert!((back.height().value().metres() - 48.0).abs() < 1e-3);Structs§
- Datum
- Horizontal geodetic datum: ellipsoid and its transformation to WGS 84.
- Ecef
Point - Earth-centred, Earth-fixed Cartesian point, metres.
- Ellipsoid
- Reference ellipsoid.
- Geodetic
Point - Position with height.
- Height
- Height with its vertical datum.
- Helmert
- Seven-parameter Helmert transformation between geocentric frames: translation, small rotation, scale.
Enums§
- Vertical
Datum - Vertical datum.