forked from organicmaps/organicmaps
Process features with names only for address lookup.
This commit is contained in:
parent
2daef24bc1
commit
58e55db2d7
2 changed files with 13 additions and 4 deletions
|
@ -323,7 +323,7 @@ pair<int, int> 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<int, int> 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<int, int> 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;
|
||||
|
|
|
@ -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<int, int> 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<int, int> const r = feature::GetDrawableScaleRangeForText(types);
|
||||
return my::between_s(r.first, r.second, m_scale);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Reference in a new issue