MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_geoid.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2 * mrtk_geoid.h : geoid model functions
3 *
4 * Copyright (C) 2026 H.SHIONO (MRTKLIB Project)
5 * Copyright (C) 2023-2025 Cabinet Office, Japan
6 * Copyright (C) 2024-2025 Lighthouse Technology & Consulting Co. Ltd.
7 * Copyright (C) 2023-2025 Japan Aerospace Exploration Agency
8 * Copyright (C) 2023-2025 TOSHIBA ELECTRONIC TECHNOLOGIES CORPORATION
9 * Copyright (C) 2015- Mitsubishi Electric Corp.
10 * Copyright (C) 2014 Geospatial Information Authority of Japan
11 * Copyright (C) 2014 T.SUZUKI
12 * Copyright (C) 2007-2023 T.TAKASU
13 *
14 * SPDX-License-Identifier: BSD-2-Clause
15 *----------------------------------------------------------------------------*/
16/**
17 * @file mrtk_geoid.h
18 * @brief MRTKLIB Geoid Module — Geoid height models.
19 *
20 * This header declares the public geoid functions (opengeoid, closegeoid,
21 * geoidh) and geoid model constants extracted from geoid.c.
22 *
23 * @note All functions in this module are pure cut-and-paste extractions
24 * from geoid.c with zero algorithmic changes.
25 */
26#ifndef MRTK_GEOID_H
27#define MRTK_GEOID_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*============================================================================
34 * Geoid Model Constants
35 *===========================================================================*/
36
37#define GEOID_EMBEDDED 0 /**< geoid model: embedded geoid (1x1 deg) */
38#define GEOID_EGM96_M150 1 /**< geoid model: EGM96 15x15" */
39#define GEOID_EGM2008_M25 2 /**< geoid model: EGM2008 2.5x2.5" */
40#define GEOID_EGM2008_M10 3 /**< geoid model: EGM2008 1.0x1.0" */
41#define GEOID_GSI2000_M15 4 /**< geoid model: GSI geoid 2000 1.0x1.5" */
42#define GEOID_RAF09 5 /**< geoid model: IGN RAF09 for France 1.5"x2" */
43
44/*============================================================================
45 * Geoid Functions
46 *===========================================================================*/
47
48/**
49 * @brief Open geoid model file.
50 * @param[in] model Geoid model type (GEOID_EMBEDDED, GEOID_EGM96_M150, etc.)
51 * @param[in] file Geoid model file path
52 * @return Status (1:ok, 0:error)
53 * @note The following geoid models can be used:
54 * - WW15MGH.DAC: EGM96 15x15" binary grid height
55 * - Und_min2.5x2.5_egm2008_isw=82_WGS84_TideFree_SE: EGM2008 2.5x2.5"
56 * - Und_min1x1_egm2008_isw=82_WGS84_TideFree_SE: EGM2008 1.0x1.0"
57 * - gsigeome_ver4: GSI geoid 2000 1.0x1.5" (Japanese area)
58 * (byte-order of binary files must be compatible to CPU)
59 */
60int opengeoid(int model, const char* file);
61
62/**
63 * @brief Close geoid model file.
64 */
65void closegeoid(void);
66
67/**
68 * @brief Get geoid height from geoid model.
69 * @param[in] pos Geodetic position {lat, lon} (rad)
70 * @return Geoid height (m) (0.0: error)
71 * @note To use external geoid model, call opengeoid() before this function.
72 * If no external model is open, the embedded geoid model is used.
73 */
74double geoidh(const double* pos);
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* MRTK_GEOID_H */
void closegeoid(void)
Close geoid model file.
Definition mrtk_geoid.c:251
int opengeoid(int model, const char *file)
Open geoid model file.
Definition mrtk_geoid.c:227
double geoidh(const double *pos)
Get geoid height from geoid model.
Definition mrtk_geoid.c:268