mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 05:43:37 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
47
generator/check_model.cpp
Normal file
47
generator/check_model.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "generator/check_model.hpp"
|
||||
|
||||
#include "defines.hpp"
|
||||
|
||||
#include "indexer/features_vector.hpp"
|
||||
#include "indexer/classificator.hpp"
|
||||
#include "indexer/feature_visibility.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace check_model
|
||||
{
|
||||
using namespace feature;
|
||||
|
||||
void ReadFeatures(std::string const & fName)
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
|
||||
FeaturesVectorTest(fName).GetVector().ForEach([&](FeatureType & ft, uint32_t)
|
||||
{
|
||||
TypesHolder types(ft);
|
||||
|
||||
std::vector<uint32_t> vTypes;
|
||||
for (uint32_t t : types)
|
||||
{
|
||||
CHECK_EQUAL(c.GetTypeForIndex(c.GetIndexForType(t)), t, ());
|
||||
vTypes.push_back(t);
|
||||
}
|
||||
|
||||
sort(vTypes.begin(), vTypes.end());
|
||||
CHECK(unique(vTypes.begin(), vTypes.end()) == vTypes.end(), ());
|
||||
|
||||
m2::RectD const r = ft.GetLimitRect(FeatureType::BEST_GEOMETRY);
|
||||
CHECK(r.IsValid(), ());
|
||||
|
||||
GeomType const type = ft.GetGeomType();
|
||||
if (type == GeomType::Line)
|
||||
CHECK_GREATER(ft.GetPointsCount(), 1, ());
|
||||
|
||||
CHECK(CanGenerateLike(vTypes, ft.GetGeomType()), ());
|
||||
});
|
||||
|
||||
LOG(LINFO, ("OK"));
|
||||
}
|
||||
} // namespace check_model
|
||||
Reference in New Issue
Block a user