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

city_finder.hpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f7b38f3e521fe2b68a68f7c60c3f10ee378ffc0b (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
#pragma once

#include "search/categories_cache.hpp"
#include "search/locality_finder.hpp"

#include "geometry/point2d.hpp"

#include "base/cancellable.hpp"

#include <cstdint>
#include <string>

class DataSourceBase;
struct FeatureID;

namespace search
{
class CityFinder
{
public:
  // TODO (@milchakov): consider to reuse locality finder from search
  // engine.  Otherwise, CityFinder won't benefit from approximated
  // cities boundaries.
  explicit CityFinder(DataSourceBase const & dataSource);

  std::string GetCityName(m2::PointD const & p, int8_t lang);
  FeatureID GetCityFeatureID(m2::PointD const & p);

private:
  ::base::Cancellable m_cancellable;
  search::CitiesBoundariesTable m_unusedBoundaries;
  search::VillagesCache m_unusedCache;
  search::LocalityFinder m_finder;
};
}  // namespace search