This commit is contained in:
Lev Dragunov 2015-08-06 10:48:17 +03:00 committed by Alex Zolotarev
parent 389d00224b
commit 3b61add6ed
2 changed files with 8 additions and 7 deletions

View file

@ -2326,14 +2326,16 @@ RouterType Framework::GetBestRouter(m2::PointD const & startPoint, m2::PointD co
return RouterType::Pedestrian;
else
{
// Return on short calls the vehicle router flag only if we are already have routing files.
// Return on a short distance the vehicle router flag only if we are already have routing files.
auto countryFileGetter = [this](m2::PointD const & p)
{
return GetSearchEngine()->GetCountryFile(p);
};
if (!OsrmRouter::CheckRoutingAbility(startPoint, finalPoint, countryFileGetter,
&m_model.GetIndex()))
{
return RouterType::Pedestrian;
}
}
}
return RouterType::Vehicle;

View file

@ -335,13 +335,12 @@ private:
} // namespace
// static
bool OsrmRouter::CheckRoutingAbility(m2::PointD const & startPoint,
m2::PointD const & finalPoint,
TCountryFileFn const & countryFileFn, Index * index)
bool OsrmRouter::CheckRoutingAbility(m2::PointD const & startPoint, m2::PointD const & finalPoint,
TCountryFileFn const & countryFileFn, Index * index)
{
RoutingIndexManager manager(countryFileFn, index);
return manager.GetMappingByPoint(startPoint)->IsValid() &&
manager.GetMappingByPoint(finalPoint)->IsValid();
RoutingIndexManager manager(countryFileFn, index);
return manager.GetMappingByPoint(startPoint)->IsValid() &&
manager.GetMappingByPoint(finalPoint)->IsValid();
}
OsrmRouter::OsrmRouter(Index * index, TCountryFileFn const & countryFileFn)