mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
Print SRTM tiles usage.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
@@ -3,17 +3,14 @@
|
||||
|
||||
#include "routing/routing_helpers.hpp"
|
||||
|
||||
#include "indexer/altitude_loader.hpp"
|
||||
#include "indexer/feature.hpp"
|
||||
#include "indexer/feature_altitude.hpp"
|
||||
#include "indexer/feature_data.hpp"
|
||||
#include "indexer/feature_processor.hpp"
|
||||
|
||||
#include "coding/files_container.hpp"
|
||||
#include "coding/reader.hpp"
|
||||
#include "coding/succinct_mapper.hpp"
|
||||
|
||||
#include "geometry/latlon.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
#include "base/checked_cast.hpp"
|
||||
#include "base/logging.hpp"
|
||||
@@ -43,6 +40,12 @@ public:
|
||||
return m_srtmManager.GetTriangleHeight(mercator::ToLatLon(p));
|
||||
}
|
||||
|
||||
void PrintStatsAndPurge() override
|
||||
{
|
||||
LOG(LINFO, ("Srtm tiles number (x26Mb):", m_srtmManager.GeTilesNumber()));
|
||||
m_srtmManager.Purge();
|
||||
}
|
||||
|
||||
private:
|
||||
generator::SrtmTileManager m_srtmManager;
|
||||
};
|
||||
@@ -84,6 +87,7 @@ public:
|
||||
return;
|
||||
|
||||
geometry::Altitudes altitudes;
|
||||
altitudes.reserve(pointsCount);
|
||||
Altitude minFeatureAltitude = geometry::kInvalidAltitude;
|
||||
for (size_t i = 0; i < pointsCount; ++i)
|
||||
{
|
||||
@@ -124,7 +128,6 @@ public:
|
||||
succinct::bit_vector_builder m_altitudeAvailabilityBuilder;
|
||||
Altitude m_minAltitude;
|
||||
|
||||
private:
|
||||
AltitudeGetter & m_altitudeGetter;
|
||||
};
|
||||
} // namespace
|
||||
@@ -136,6 +139,7 @@ void BuildRoadAltitudes(std::string const & mwmPath, AltitudeGetter & altitudeGe
|
||||
// Preparing altitude information.
|
||||
Processor processor(altitudeGetter);
|
||||
feature::ForEachFeature(mwmPath, processor);
|
||||
processor.m_altitudeGetter.PrintStatsAndPurge();
|
||||
|
||||
if (!processor.HasAltitudeInfo())
|
||||
{
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include "geometry/point2d.hpp"
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
|
||||
#include "indexer/feature_altitude.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace routing
|
||||
@@ -13,6 +11,7 @@ class AltitudeGetter
|
||||
{
|
||||
public:
|
||||
virtual geometry::Altitude GetAltitude(m2::PointD const & p) = 0;
|
||||
virtual void PrintStatsAndPurge() {}
|
||||
};
|
||||
|
||||
/// \brief Adds altitude section to mwm. It has the following format:
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
return GetTile(coord).GetTriangleHeight(coord);
|
||||
}
|
||||
|
||||
size_t GeTilesNumber() const { return m_tiles.size(); }
|
||||
|
||||
void Purge();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user