forked from organicmaps/organicmaps-tmp
[search] Special treatment for internet_access and wheelchair types
This commit is contained in:
parent
b7b98f376f
commit
135290d877
4 changed files with 30 additions and 0 deletions
|
@ -100,6 +100,7 @@ void GetCategoryTypes(CategoriesHolder const & categories, pair<int, int> const
|
|||
feature::TypesHolder const & types, vector<uint32_t> & result)
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
auto const & invisibleChecker = ftypes::IsInvisibleIndexedChecker::Instance();
|
||||
|
||||
for (uint32_t t : types)
|
||||
{
|
||||
|
@ -112,6 +113,13 @@ void GetCategoryTypes(CategoriesHolder const & categories, pair<int, int> const
|
|||
if (!categories.IsTypeExist(t))
|
||||
continue;
|
||||
|
||||
// There are some special non-drawable types we plan to search on.
|
||||
if (invisibleChecker(t))
|
||||
{
|
||||
result.push_back(t);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Index only those types that are visible.
|
||||
pair<int, int> r = feature::GetDrawableScaleRange(t);
|
||||
CHECK_LESS_OR_EQUAL(r.first, r.second, (c.GetReadableObjectName(t)));
|
||||
|
|
|
@ -208,6 +208,7 @@ namespace
|
|||
|
||||
/// Add here all exception classificator types: needed for algorithms,
|
||||
/// but don't have drawing rules.
|
||||
/// See also ftypes_matcher.cpp, IsInvisibleIndexedChecker.
|
||||
bool TypeAlwaysExists(uint32_t type, EGeomType g = GEOM_UNDEFINED)
|
||||
{
|
||||
static const uint32_t roundabout = classif().GetTypeByPath({ "junction", "roundabout" });
|
||||
|
|
|
@ -431,6 +431,18 @@ IsOpentableChecker const & IsOpentableChecker::Instance()
|
|||
return inst;
|
||||
}
|
||||
|
||||
IsInvisibleIndexedChecker::IsInvisibleIndexedChecker() : BaseChecker(1 /* level */)
|
||||
{
|
||||
m_types.push_back(classif().GetTypeByPath({"internet_access"}));
|
||||
m_types.push_back(classif().GetTypeByPath({"wheelchair"}));
|
||||
}
|
||||
|
||||
IsInvisibleIndexedChecker const & IsInvisibleIndexedChecker::Instance()
|
||||
{
|
||||
static IsInvisibleIndexedChecker const instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
IsLocalityChecker::IsLocalityChecker()
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
|
|
|
@ -192,6 +192,15 @@ public:
|
|||
static IsOpentableChecker const & Instance();
|
||||
};
|
||||
|
||||
// Checks for types that are not drawable, but searchable.
|
||||
class IsInvisibleIndexedChecker : public BaseChecker
|
||||
{
|
||||
IsInvisibleIndexedChecker();
|
||||
|
||||
public:
|
||||
static IsInvisibleIndexedChecker const & Instance();
|
||||
};
|
||||
|
||||
/// Type of locality (do not change values and order - they have detalization order)
|
||||
/// COUNTRY < STATE < CITY < ...
|
||||
enum Type { NONE = -1, COUNTRY = 0, STATE, CITY, TOWN, VILLAGE, LOCALITY_COUNT };
|
||||
|
|
Loading…
Add table
Reference in a new issue