Ref T773, utility functions to clean cache and find max. elevation

This commit is contained in:
Klaus Basan
2020-02-19 02:10:26 +01:00
committed by Mat Sutcliffe
parent 466c761616
commit ab41c1e930
4 changed files with 100 additions and 0 deletions

View File

@@ -133,6 +133,20 @@ namespace BlackMisc
return stats;
}
template<class OBJ, class CONTAINER>
CAltitude IGeoObjectList<OBJ, CONTAINER>::findMaxHeight() const
{
if (this->container().isEmpty()) { return CAltitude::null(); }
CAltitude max = CAltitude::null();
for (const OBJ &obj : this->container())
{
if (!obj.hasMSLGeodeticHeight()) { continue; }
const CAltitude alt = obj.geodeticHeight();
if (max.isNull() || alt > max) { max = alt; }
}
return max;
}
template <class OBJ, class CONTAINER>
int IGeoObjectList<OBJ, CONTAINER>::removeOutsideRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range)
{

View File

@@ -83,6 +83,9 @@ namespace BlackMisc
//! Find min/max/average height
MinMaxAverageHeight findMinMaxAverageHeight() const;
//! Find min/max/average height
Aviation::CAltitude findMaxHeight() const;
//! Remove outside range
int removeOutsideRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range);