cesium-native  0.41.0
EarthGravitationalModel1996Grid.h
1 #pragma once
2 
3 #include "Library.h"
4 
5 #include <gsl/span>
6 
7 #include <cstdint>
8 #include <optional>
9 #include <string>
10 #include <vector>
11 
12 namespace CesiumGeospatial {
13 
14 class Cartographic;
15 
24 class CESIUMGEOSPATIAL_API EarthGravitationalModel1996Grid final {
25 public:
36  static std::optional<EarthGravitationalModel1996Grid>
37  fromBuffer(const gsl::span<const std::byte>& buffer);
38 
48  double sampleHeight(const Cartographic& position) const;
49 
50 private:
51  EarthGravitationalModel1996Grid(std::vector<int16_t>&& gridValues);
52 
56  double getHeightForIndices(size_t vertical, size_t horizontal) const;
57 
58  std::vector<int16_t> _gridValues;
59 };
60 
61 } // namespace CesiumGeospatial
A position defined by longitude, latitude, and height.
Definition: Cartographic.h:12
Loads and queries heights from an Earth Gravitational Model 1996 (EGM96) grid.
double sampleHeight(const Cartographic &position) const
Samples the height at the given position.
static std::optional< EarthGravitationalModel1996Grid > fromBuffer(const gsl::span< const std::byte > &buffer)
Attempts to create a EarthGravitationalModel1996Grid from the given buffer.
Classes for geospatial computations in Cesium.