Class GeoidUndulationSource
Defined in File GeoidUndulationSource.hpp
Inheritance Relationships
Base Type
public navtk::geospatial::SpatialMapDataSource(Class SpatialMapDataSource)
Class Documentation
Class used to read geoid undulation data from ‘WW15MGH.GRD’, a standard undulation file available from https://earth-info.gs.mil/.
Geoid height is the actual height above mean sea level (often abbreviated MSL).
Ellipsoid height is the height above an ellipsoid model of the Earth (often abbreviated HAE).
Geoid undulation is the geoid height relative to the ellipsoid height (i.e. geoid height minus ellipsoid height).
The file begins with a header line containing the range of latitudes and longitudes covered by the file, as well as the steps between each. Steps in current file version are 0.25 degrees, and are unlikely to change. The file is then separated into ‘records’. Each record contains all undulation values at a given latitude for the entire span of longitudes. The first record contains the undulations at latitude 90 deg, the second 89.75 deg, and so on to -90 deg. Each record contains 1441 undulation values for longitudes from 0 to 360 deg. Each ‘record’ is comprised of 9 ‘blocks’, each preceded by an empty line, and then a single value corresponding to a longitude of 360 on another line, also preceded by an empty line. Each ‘block’ is comprised of 20 lines with 8 undulation values per line. Block 0 covers longitude 0 to 39.75 deg, Block 1 40 to 79.75 deg, and so on until 359.75 deg longitude. Each line in a block contains 8 values, with each value being allowed a 9 character spacing, except the first (which has 10). The 10 character limit also applies to the single values corresponding to lon = 360.
Public Functions
Gets the geoid undulation at a given latitude and longitude.
- Parameters
latitude – Latitude value in radians, in range [-PI/2, PI/2]
longitude – Longitude value in radians
- Returns
A
pairshowing whether a height was found (.first) and iftrue, the geoid undulation in meters. If the provided latitude and longitude are in a valid range, then an undulation value will be returned; otherwise,.firstwill befalse.
Allows the user to change the size of a chunk stored in memory.
- Parameters
size – New chunk size. Must be greater than 0 to allow for interpolation. The size is the length of each dimension of the undulation Matrix. This length includes the values at each corner. Thus, the total number of values stored = (size + 1)^2.
- Returns
The current chunk size.
Public Static Functions
Gets singleton object, constructing new instance if necessary.
Upon construction, adds the path to the Geoid Undulation data file, ‘WW15MGH.GRD’. Opens the file, reads past the 6 header values describing the range the file covers. Yields runtime error if the file is not found or if the header values are invalid.
- Parameters
path – the path to the geoid undulation file for converting between HAE and MSL. The default path of this variable requires setting the NAVTK_DATA_DIR environment variable to the folder containing the undulation file, or setting the NAVTK_GEOID_UNDULATION_PATH environment variable to the path of the file itself.
- Returns
The singleton object.