Program Listing for File GdalSource.hpp

Return to documentation for file (optional/gdal/src/navtk/geospatial/sources/GdalSource.hpp)

#pragma once

#include <memory>
#include <utility>
#include <vector>

#include <navtk/aspn.hpp>
#include <navtk/geospatial/TileStorage.hpp>
#include <navtk/geospatial/sources/ElevationSource.hpp>

namespace navtk {
namespace geospatial {
class GdalSource : public ElevationSource {
public:
    enum class MapType {
        GEOTIFF,
        DTED
    };

    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");

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

    void set_output_vertical_reference_frame(AspnMeasurementAltitudeReference new_ref) override;

private:
    mutable TileStorage storage;

    std::vector<std::shared_ptr<Tile>> known_tiles;

    const MapType map_type;
    std::string undulation_path;
};
}  // namespace geospatial
}  // namespace navtk