Geoid undulation lookup and orthometric/ellipsoidal height conversion.
The geoid undulation N is the height of the geoid (mean sea level) above the
WGS84 ellipsoid in metres. GNSS yields the ellipsoidal height h; the
orthometric height (height above mean sea level) is H = h - N.
Two entry points are exposed over the sidereon-core geoid module:
- zero-setup lookups against the crate's COARSE 30-degree built-in global grid
(
undulation/2,orthometric_height_m/3,ellipsoidal_height_m/3), and - a loaded grid handle (
load_grid/1,grid/7) for a real vendor model, queried withgrid_undulation_deg/3/grid_undulation_rad/3, and - PROJ 9.3.0-compatible EGM96 GTX loading and vertical-grid interpolation with an explicit fused or separately rounded arithmetic mode.
The built-in grid is suitable for sanity checks and metre-scale fallback, not survey work; load a real model for accuracy.
Latitude is positive north, longitude positive east. The built-in lookups and
grid_undulation_rad/3 take radians; grid_undulation_deg/3 takes degrees.
Summary
Functions
Ellipsoidal height h = H + N (metres) from an orthometric height, using the
embedded genuine EGM96 1-degree model. Position in radians.
Orthometric height H = h - N (metres) from an ellipsoidal height, using the
embedded genuine EGM96 1-degree model. Position in radians.
Geoid undulation N (metres) at a geodetic position in radians, from the
embedded genuine EGM96 1-degree global grid.
Embedded EGM96 1-degree undulations N (metres) for positions in radians.
Embedded EGM96 1-degree undulations N (metres) for positions in degrees.
Ellipsoidal height h = H + N (metres) from an orthometric height, using the
built-in grid. Position in radians.
Alias for load_egm96_dac/1.
Alias for load_proj_egm96_gtx/1, matching the core GeoidGrid constructor.
Alias for load_grid/1, matching the Python GeoidGrid.from_text name.
Build a geoid grid handle from its origin, spacing, dimensions, and row-major samples (metres).
Loaded-grid ellipsoidal height h = H + N (metres), position in degrees.
Loaded-grid ellipsoidal height h = H + N (metres), position in radians.
Loaded-grid orthometric height H = h - N (metres), position in degrees.
Loaded-grid orthometric height H = h - N (metres), position in radians.
Bilinearly interpolated undulation N (metres) from a loaded grid handle, at a
geodetic position in degrees.
Interpolate a loaded EGM96 GTX grid using PROJ 9.3.0's radian indexing and blend order.
Bilinearly interpolated undulation N (metres) from a loaded grid handle, at a
geodetic position in radians.
Bilinearly interpolated undulations N (metres) from a loaded grid, with
positions in degrees.
Bilinearly interpolated undulations N (metres) from a loaded grid, with
positions in radians.
Parse a full EGM96 WW15MGH.DAC byte buffer into a grid handle.
Parse a full NGA EGM2008 interpolation raster into a grid handle.
Parse a cropped EGM2008 interpolation-raster window descriptor into a grid handle.
Parse a cropped NGA EGM2008 interpolation-raster window into a grid handle.
Parse a geoid grid in the crate's documented text format into a handle.
Parse PROJ's public EGM96 15-arcminute egm96_15.gtx into a grid handle.
Orthometric height H = h - N (metres) from an ellipsoidal height, using the
built-in grid. Position in radians.
Built-in coarse-grid geoid undulation N (metres) at a geodetic position in
radians.
Built-in coarse-grid geoid undulations N (metres) for positions in radians.
Built-in coarse-grid geoid undulations N (metres) for positions in degrees.
Types
Functions
Ellipsoidal height h = H + N (metres) from an orthometric height, using the
embedded genuine EGM96 1-degree model. Position in radians.
Orthometric height H = h - N (metres) from an ellipsoidal height, using the
embedded genuine EGM96 1-degree model. Position in radians.
Geoid undulation N (metres) at a geodetic position in radians, from the
embedded genuine EGM96 1-degree global grid.
This is the recommended zero-setup default for metre-class datum work: its
bilinear lookup agrees with the full 15-arcminute EGM96 grid to ~0.4 m RMS,
far better than the coarse 30-degree built-in undulation/2.
Embedded EGM96 1-degree undulations N (metres) for positions in radians.
Embedded EGM96 1-degree undulations N (metres) for positions in degrees.
Ellipsoidal height h = H + N (metres) from an orthometric height, using the
built-in grid. Position in radians.
Alias for load_egm96_dac/1.
@spec from_egm2008_raster(binary(), egm2008_spacing()) :: {:ok, grid()} | {:error, term()}
Alias for load_egm2008_raster/2.
@spec from_egm2008_raster_window(binary(), Sidereon.Geoid.Egm2008RasterWindow.t()) :: {:ok, grid()} | {:error, term()}
Alias for load_egm2008_raster_window/2.
Alias for load_proj_egm96_gtx/1, matching the core GeoidGrid constructor.
Alias for load_grid/1, matching the Python GeoidGrid.from_text name.
@spec grid( number(), number(), number(), number(), non_neg_integer(), non_neg_integer(), [number()] ) :: {:ok, grid()} | {:error, term()}
Build a geoid grid handle from its origin, spacing, dimensions, and row-major samples (metres).
values_m is a flat list of n_lat * n_lon floats. Returns
{:ok, reference()} or {:error, reason}.
Loaded-grid ellipsoidal height h = H + N (metres), position in degrees.
Loaded-grid ellipsoidal height h = H + N (metres), position in radians.
Loaded-grid orthometric height H = h - N (metres), position in degrees.
Loaded-grid orthometric height H = h - N (metres), position in radians.
Bilinearly interpolated undulation N (metres) from a loaded grid handle, at a
geodetic position in degrees.
@spec grid_undulation_proj_rad( grid(), number(), number(), proj_vgridshift_arithmetic() ) :: {:ok, float()} | {:error, Sidereon.Geoid.ProjVgridshiftError.t()}
Interpolate a loaded EGM96 GTX grid using PROJ 9.3.0's radian indexing and blend order.
arithmetic must be :separate_multiply_add or :fused_multiply_add. PROJ's
source does not prescribe floating-point contraction, so the mode is required
rather than inferred from the current CPU. Invalid coordinates return a
typed ProjVgridshiftError and are never clamped or extrapolated.
Bilinearly interpolated undulation N (metres) from a loaded grid handle, at a
geodetic position in radians.
Bilinearly interpolated undulations N (metres) from a loaded grid, with
positions in degrees.
Bilinearly interpolated undulations N (metres) from a loaded grid, with
positions in radians.
Parse a full EGM96 WW15MGH.DAC byte buffer into a grid handle.
@spec load_egm2008_raster(binary(), egm2008_spacing()) :: {:ok, grid()} | {:error, term()}
Parse a full NGA EGM2008 interpolation raster into a grid handle.
spacing is :one_minute or :two_point_five_minute. The returned handle
uses the same grid_undulation_* and height-conversion functions as every
loaded grid.
@spec load_egm2008_raster_window(binary(), Sidereon.Geoid.Egm2008RasterWindow.t()) :: {:ok, grid()} | {:error, term()}
Parse a cropped EGM2008 interpolation-raster window descriptor into a grid handle.
@spec load_egm2008_raster_window( binary(), egm2008_spacing(), number(), number(), pos_integer(), pos_integer() ) :: {:ok, grid()} | {:error, term()}
Parse a cropped NGA EGM2008 interpolation-raster window into a grid handle.
lat_min_deg and lon_min_deg are the southwest node of the crop in degrees.
n_lat and n_lon are the row and column counts carried by bytes.
Parse a geoid grid in the crate's documented text format into a handle.
The format is whitespace-delimited with # comments: a six-field header
lat_min lon_min dlat dlon n_lat n_lon (degrees) followed by n_lat * n_lon
undulation samples in metres, row-major (latitude ascending outer). Returns
{:ok, reference()} or {:error, reason}.
Parse PROJ's public EGM96 15-arcminute egm96_15.gtx into a grid handle.
Query the returned handle with grid_undulation_proj_rad/4. The ordinary
loaded-grid functions retain Sidereon's general interpolation contract.
Orthometric height H = h - N (metres) from an ellipsoidal height, using the
built-in grid. Position in radians.
Built-in coarse-grid geoid undulation N (metres) at a geodetic position in
radians.
Built-in coarse-grid geoid undulations N (metres) for positions in radians.
Built-in coarse-grid geoid undulations N (metres) for positions in degrees.