Welcome to mirror list, hosted at ThFree Co, Russian Federation.

check_model.cpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a175f2ff491fa536312d001e0171c533bf844062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "check_model.hpp"

#include "../indexer/features_vector.hpp"

#include "../defines.hpp"


namespace check_model
{
  class DoFullRead
  {
  public:
    void operator() (FeatureType const & ft, uint32_t /*pos*/)
    {
      m2::RectD const r = ft.GetLimitRect(FeatureType::BEST_GEOMETRY);
      CHECK(r.IsValid(), ());
    }
  };

  void ReadFeatures(string const & fName)
  {
    try
    {
      FilesContainerR cont(fName);

      feature::DataHeader header;
      header.Load(cont.GetReader(HEADER_FILE_TAG));

      FeaturesVector vec(cont, header);
      vec.ForEachOffset(DoFullRead());
    }
    catch (RootException const & e)
    {
      LOG(LERROR, ("Can't open or read file", fName));
    }
  }
}