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

emitter_restaurants.cpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ffbca9cc4efc2850ae11980e00b0a0a094768958 (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
38
39
40
41
42
43
44
#include "generator/emitter_restaurants.hpp"

#include "indexer/ftypes_matcher.hpp"
#include "generator/feature_builder.hpp"

namespace generator
{
EmitterRestaurants::EmitterRestaurants(std::vector<FeatureBuilder1> & features)
  : m_features(features)
{
}

void EmitterRestaurants::Process(FeatureBuilder1 & fb)
{
  if (!ftypes::IsEatChecker::Instance()(fb.GetParams().m_types) || fb.GetParams().name.IsEmpty())
  {
    ++m_stats.m_unexpectedFeatures;
    return;
  }

  switch (fb.GetGeomType())
  {
  case feature::GeomType::Point: ++m_stats.m_restaurantsPoi; break;
  case feature::GeomType::Area: ++m_stats.m_restaurantsBuilding; break;
  default: ++m_stats.m_unexpectedFeatures;
  }
  m_features.emplace_back(fb);
}

void EmitterRestaurants::GetNames(std::vector<std::string> & names) const
{
  // We do not need to create any data file. See generator_tool.cpp and osm_source.cpp.
  names.clear();
}

bool EmitterRestaurants::Finish()
{
  LOG_SHORT(LINFO, ("Number of restaurants: POI:", m_stats.m_restaurantsPoi,
                    "BUILDING:", m_stats.m_restaurantsBuilding,
                    "TOTAL:", m_features.size(),
                    "INVALID:", m_stats.m_unexpectedFeatures));
  return true;
}
}  // namespace generator