mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Added SrtmTileManager::GetBilinearHeight.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
ac50520ca8
commit
767f27e00a
@@ -30,8 +30,15 @@ public:
|
||||
/// @{
|
||||
/// Nearest serialized height.
|
||||
geometry::Altitude GetHeight(ms::LatLon const & coord) const;
|
||||
/// Height from underlying triangle (better than GetHeight).
|
||||
geometry::Altitude GetTriangleHeight(ms::LatLon const & coord) const;
|
||||
/// Triangle interpolation.
|
||||
double GetTriangleHeight(ms::LatLon const & coord) const;
|
||||
/// Bilinear interpolation.
|
||||
double GetBilinearHeight(ms::LatLon const & coord) const;
|
||||
|
||||
geometry::Altitude GetAltitude(ms::LatLon const & coord) const
|
||||
{
|
||||
return static_cast<geometry::Altitude>(std::round(GetBilinearHeight(coord)));
|
||||
}
|
||||
/// @}
|
||||
|
||||
using LatLonKey = std::pair<int32_t, int32_t>;
|
||||
@@ -68,14 +75,9 @@ public:
|
||||
|
||||
SrtmTile const & GetTile(ms::LatLon const & coord);
|
||||
|
||||
geometry::Altitude GetHeight(ms::LatLon const & coord)
|
||||
geometry::Altitude GetAltitude(ms::LatLon const & coord)
|
||||
{
|
||||
return GetTile(coord).GetHeight(coord);
|
||||
}
|
||||
|
||||
geometry::Altitude GetTriangleHeight(ms::LatLon const & coord)
|
||||
{
|
||||
return GetTile(coord).GetTriangleHeight(coord);
|
||||
return GetTile(coord).GetAltitude(coord);
|
||||
}
|
||||
|
||||
size_t GeTilesNumber() const { return m_tiles.size(); }
|
||||
|
||||
Reference in New Issue
Block a user