Memory-mappable terrain store conversion and lookup.
A terrain store is a single byte container built from DTED tiles. The reader
can be opened from bytes with from_bytes/1 or from a path with from_path/1.
Heights returned by this module are typed as orthometric height H in metres
above the EGM96 mean sea level geoid. Use the ellipsoidal conversion functions
when a WGS84 ellipsoidal height h = H + N is needed.
Terrain lookup axes are always (longitude_deg, latitude_deg).
Summary
Types
Terrain interpolation method.
Parsed terrain store handle.
Terrain datum conversion or geoid-grid loading error.
Terrain store conversion or parse error.
Functions
Return a checksum for a parsed store handle or terrain store bytes.
Convert a DTED tile tree into terrain store bytes.
Return WGS84 ellipsoidal terrain height using the embedded EGM96 1-degree grid.
Return WGS84 ellipsoidal terrain height with an explicit geoid model.
Return WGS84 ellipsoidal terrain height with lookup options.
Parse terrain store bytes into a reader handle.
Read a terrain store file into a reader handle.
Parse owned terrain store bytes into a reader handle.
Evaluate (longitude_deg, latitude_deg) points as orthometric heights.
Return orthometric terrain height at (longitude_deg, latitude_deg).
Return orthometric terrain height at (longitude_deg, latitude_deg) with lookup options.
Evaluate (longitude_deg, latitude_deg) points as typed orthometric heights.
Return typed orthometric terrain height at (longitude_deg, latitude_deg).
Return typed orthometric terrain height with lookup options.
Return the FNV-1a checksum for terrain store bytes.
Return parsed tile index records.
Return canonical terrain store bytes from a parsed handle.
Return the file-level vertical datum.
Convert a DTED tile tree and write terrain store bytes to out_path.
Types
@type interpolation() :: :bilinear | :nearest_posting
Terrain interpolation method.
@type t() :: %Sidereon.Terrain.MmapTerrain{handle: reference()}
Parsed terrain store handle.
@type terrain_datum_error() :: Sidereon.Terrain.MmapTerrain.TerrainDatumError.t()
Terrain datum conversion or geoid-grid loading error.
@type terrain_store_error() :: Sidereon.Terrain.MmapTerrain.TerrainStoreError.t()
Terrain store conversion or parse error.
Functions
@spec checksum64(t() | binary()) :: non_neg_integer()
Return a checksum for a parsed store handle or terrain store bytes.
@spec dted_tree_to_mmap_store(String.t()) :: {:ok, binary()} | {:error, terrain_store_error() | term()}
Convert a DTED tile tree into terrain store bytes.
@spec ellipsoidal_height_m(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.EllipsoidalHeightM.t()} | {:error, terrain_datum_error() | term()}
Return WGS84 ellipsoidal terrain height using the embedded EGM96 1-degree grid.
@spec ellipsoidal_height_m_with_model( t(), number(), number(), Sidereon.Terrain.MmapTerrain.TerrainGeoidModel.t() | :egm96_one_degree, keyword() ) :: {:ok, Sidereon.Terrain.MmapTerrain.EllipsoidalHeightM.t()} | {:error, terrain_datum_error() | term()}
Return WGS84 ellipsoidal terrain height with an explicit geoid model.
Passing TerrainGeoidModel.egm96_fifteen_minute/1 requires a loaded
Egm96FifteenMinuteGeoid; it never falls back to the embedded 1-degree grid.
@spec ellipsoidal_height_m_with_options(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.EllipsoidalHeightM.t()} | {:error, terrain_datum_error() | term()}
Return WGS84 ellipsoidal terrain height with lookup options.
@spec from_bytes(binary()) :: {:ok, t()} | {:error, terrain_store_error() | term()}
Parse terrain store bytes into a reader handle.
@spec from_path(String.t()) :: {:ok, t()} | {:error, terrain_store_error() | term()}
Read a terrain store file into a reader handle.
@spec from_vec(binary()) :: {:ok, t()} | {:error, terrain_store_error() | term()}
Parse owned terrain store bytes into a reader handle.
@spec height_batch(t(), [{number(), number()}], keyword()) :: [ok: Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t(), error: term()] | {:error, term()}
Evaluate (longitude_deg, latitude_deg) points as orthometric heights.
@spec height_m(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t()} | {:error, term()}
Return orthometric terrain height at (longitude_deg, latitude_deg).
@spec height_m_with_options(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t()} | {:error, term()}
Return orthometric terrain height at (longitude_deg, latitude_deg) with lookup options.
@spec orthometric_height_batch(t(), [{number(), number()}], keyword()) :: [ok: Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t(), error: term()] | {:error, term()}
Evaluate (longitude_deg, latitude_deg) points as typed orthometric heights.
@spec orthometric_height_m(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t()} | {:error, term()}
Return typed orthometric terrain height at (longitude_deg, latitude_deg).
@spec orthometric_height_m_with_options(t(), number(), number(), keyword()) :: {:ok, Sidereon.Terrain.MmapTerrain.OrthometricHeightM.t()} | {:error, term()}
Return typed orthometric terrain height with lookup options.
@spec terrain_store_checksum64(binary()) :: non_neg_integer()
Return the FNV-1a checksum for terrain store bytes.
@spec tile_index(t()) :: [Sidereon.Terrain.MmapTerrain.TerrainStoreTileIndex.t()]
Return parsed tile index records.
Return canonical terrain store bytes from a parsed handle.
@spec vertical_datum(t()) :: Sidereon.Terrain.MmapTerrain.VerticalDatum.t()
Return the file-level vertical datum.
@spec write_dted_tree_to_mmap_store(String.t(), String.t()) :: :ok | {:error, terrain_store_error() | term()}
Convert a DTED tile tree and write terrain store bytes to out_path.