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