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

osm_element_helpers.cpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76fc3ec31172faf8586aca9185a008a017be7785 (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
45
#include "generator/osm_element_helpers.hpp"

#include "indexer/ftypes_matcher.hpp"

#include <algorithm>
#include <set>
#include <string>

namespace generator
{
namespace osm_element
{
bool IsPoi(OsmElement const & osmElement)
{
  auto const & tags = osmElement.Tags();
  return std::any_of(std::cbegin(tags), std::cend(tags), [](OsmElement::Tag const & t) {
    return ftypes::IsPoiChecker::kPoiTypes.find(t.key) != std::end(ftypes::IsPoiChecker::kPoiTypes);
  });
}

bool IsBuilding(OsmElement const & osmElement)
{
  auto const & tags = osmElement.Tags();
  return std::any_of(std::cbegin(tags), std::cend(tags), [](OsmElement::Tag const & t) {
    return t.key == "building";
  });
}

bool HasHouse(OsmElement const & osmElement)
{
  auto const & tags = osmElement.Tags();
  return std::any_of(std::cbegin(tags), std::cend(tags), [](OsmElement::Tag const & t) {
    return t.key == "addr:housenumber" || t.key == "addr:housename";
  });
}

bool HasStreet(OsmElement const & osmElement)
{
  auto const & tags = osmElement.Tags();
  return std::any_of(std::cbegin(tags), std::cend(tags), [](OsmElement::Tag const & t) {
    return t.key == "addr:street";
  });
}
}  // namespace osm_element
}  // namespace generator