Class GdalSource

Inheritance Relationships

Base Type

Class Documentation

class GdalSource : public navtk::geospatial::ElevationSource

This is an abstract class for reading data files that conform to MIL-PRF-89020B, using Geospatial Data Abstraction Library (GDAL).

All GDAL map data sources should extend from this class.

To use this package GDAL must be installed and built with navtk.

Public Types

enum class MapType

Current GDAL implementations.

Values:

enumerator GEOTIFF

A TIFF file with georeferencing information embedded in it.

enumerator DTED

An NGA standard of terrain elevation data.

Public Functions

GdalSource(const std::string &map_path, MapType type, AspnMeasurementAltitudeReference in_ref = ASPN_MEASUREMENT_ALTITUDE_REFERENCE_HAE, AspnMeasurementAltitudeReference out_ref = ASPN_MEASUREMENT_ALTITUDE_REFERENCE_HAE, unsigned int num_tiles = 10, const std::string &undulation_path = "WW15MGH.GRD")

Constructor.

Parameters
  • map_path – to directory containing one or more GDAL data files. All GDAL files in this directory must have the same file format and vertical reference frame.

  • type – the gdal format used by the dataset.

  • in_ref – the vertical reference frame stored in the input directory. Defaults to ASPN_MEASUREMENT_ALTITUDE_REFERENCE_HAE.

  • out_ref – the vertical reference frame for output elevations. Defaults to ASPN_MEASUREMENT_ALTITUDE_REFERENCE_HAE.

  • undulation_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.

  • num_tiles – the max number of tiles to store in memory.

virtual std::pair<bool, double> lookup_datum(double latitude_rad, double longitude_rad) const override

Gets the elevation at a given latitude and longitude.

Parameters
  • latitude_rad – latitude value in radians

  • longitude_rad – longitude value in radians

Returns

A pair showing whether a valid elevation was found (.first) and if true, the elevation in meters above either geoid &#8212; aka mean sea level &#8212; or ellipsoid (.second).

virtual void set_output_vertical_reference_frame(AspnMeasurementAltitudeReference new_ref) override
Parameters

new_ref – the output vertical reference frame to change to. If new_ref is ASPN_MEASUREMENT_ALTITUDE_REFERENCE_AGL, then this function will do nothing.`