diff options
author | vng <viktor.govako@gmail.com> | 2016-04-13 16:07:35 +0300 |
---|---|---|
committer | vng <viktor.govako@gmail.com> | 2016-04-13 16:59:56 +0300 |
commit | adf8197d8a395aee92a669ef6d75a76219552869 (patch) | |
tree | f8a6bb27bc19bb157ad0bf1bdd54a20f9ee8d3e5 /indexer/ftypes_matcher.cpp | |
parent | 047ebf3c4a6eb7e0a5f6fcf67389bffa126c02d8 (diff) |
[generator] Tune threshold distance for the equal places filter algorithm.
Diffstat (limited to 'indexer/ftypes_matcher.cpp')
-rw-r--r-- | indexer/ftypes_matcher.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index 798a168fca..898327a180 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -290,26 +290,34 @@ bool IsTunnelChecker::IsMatched(uint32_t type) const return IsTypeConformed(type, {"highway", "*", "tunnel"}); } +Type IsLocalityChecker::GetType(uint32_t t) const +{ + ftype::TruncValue(t, 2); + + size_t j = COUNTRY; + for (; j < LOCALITY_COUNT; ++j) + if (t == m_types[j]) + return static_cast<Type>(j); + + for (; j < m_types.size(); ++j) + if (t == m_types[j]) + return VILLAGE; + + return NONE; +} + Type IsLocalityChecker::GetType(feature::TypesHolder const & types) const { for (uint32_t t : types) { - ftype::TruncValue(t, 2); - - size_t j = COUNTRY; - for (; j < LOCALITY_COUNT; ++j) - if (t == m_types[j]) - return static_cast<Type>(j); - - for (; j < m_types.size(); ++j) - if (t == m_types[j]) - return VILLAGE; + Type const type = GetType(t); + if (type != NONE) + return type; } - return NONE; } -Type IsLocalityChecker::GetType(const FeatureType & f) const +Type IsLocalityChecker::GetType(FeatureType const & f) const { feature::TypesHolder types(f); return GetType(types); |