Class ElevationInterpolator
Defined in File ElevationInterpolator.hpp
Class Documentation
This class uses four GDAL elevation posts and an offset from the top left post to calculate a weighted elevation value for the given offset.
Public Functions
Used to interpolate the elevation from GDAL given four adjacent posts.
- Parameters
top_left – top left post elevation
top_right – top right post elevation
bottom_left – bottom left post elevation
bottom_right – bottom right post elevation
This method interpolates a GDAL elevation using 3 linear interpolations.
One on the top posts, one on the bottom posts, and a third between the results of the first two.
Interpolate the elevation given the first element of the
std::pairis a percentage fromtop_lefttotop_rightin the x direction and the second element is a percentage fromtop_lefttobottom_leftin the y direction.- Parameters
fractions – A pair where the first is the distance from top left post to selected post in x direction (0 - 1) and the second is the distance from top left post to selected post in y direction (0 - 1)
- Returns
Interpolated elevation between the four posts.