diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index e451fcce27..327f8453f5 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -323,7 +323,7 @@ pair GetDrawableScaleRange(TypesHolder const & types) namespace { - bool IsDrawable(feature::TypesHolder const & types, int level) + bool IsDrawableText(feature::TypesHolder const & types, int level) { Classificator const & c = classif(); @@ -342,7 +342,7 @@ pair GetDrawableScaleRangeForText(feature::TypesHolder const & types) int lowL = -1; for (int level = 0; level <= upBound; ++level) { - if (IsDrawable(types, level)) + if (IsDrawableText(types, level)) { lowL = level; break; @@ -355,7 +355,7 @@ pair GetDrawableScaleRangeForText(feature::TypesHolder const & types) int highL = lowL; for (int level = upBound; level > lowL; --level) { - if (IsDrawable(types, level)) + if (IsDrawableText(types, level)) { highL = level; break; diff --git a/map/address_finder.cpp b/map/address_finder.cpp index 438411e7ee..2551f8b649 100644 --- a/map/address_finder.cpp +++ b/map/address_finder.cpp @@ -56,10 +56,13 @@ namespace virtual double GetResultDistance(double d, feature::TypesHolder const & types) const = 0; virtual double NeedProcess(feature::TypesHolder const & types) const { + // feature should be visible in needed scale pair const r = feature::GetDrawableScaleRange(types); return my::between_s(r.first, r.second, m_scale); } + /// @return epsilon value for distance compare according to priority: + /// point feature is better than linear, that is better than area. static double GetCompareEpsilonImpl(feature::EGeomType type, double eps) { using namespace feature; @@ -298,9 +301,15 @@ namespace virtual double NeedProcess(feature::TypesHolder const & types) const { if (m_doLocalities) + { return (types.GetGeoType() == feature::GEOM_POINT && m_checker.IsLocality(types)); + } else - return DoGetFeatureInfoBase::NeedProcess(types); + { + // we need features with texts for address lookup + pair const r = feature::GetDrawableScaleRangeForText(types); + return my::between_s(r.first, r.second, m_scale); + } } public: