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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2016-04-13 16:07:35 +0300
committervng <viktor.govako@gmail.com>2016-04-13 16:59:56 +0300
commitadf8197d8a395aee92a669ef6d75a76219552869 (patch)
treef8a6bb27bc19bb157ad0bf1bdd54a20f9ee8d3e5 /indexer/ftypes_matcher.cpp
parent047ebf3c4a6eb7e0a5f6fcf67389bffa126c02d8 (diff)
[generator] Tune threshold distance for the equal places filter algorithm.
Diffstat (limited to 'indexer/ftypes_matcher.cpp')
-rw-r--r--indexer/ftypes_matcher.cpp32
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);