[routing] Fix bug with some turns skip

This commit is contained in:
Denis Koronchik 2014-07-14 20:11:28 +02:00 committed by Alex Zolotarev
parent 448e23b603
commit b9ace6085b
3 changed files with 9 additions and 10 deletions

View file

@ -56,7 +56,11 @@ public:
return;
feature::TypesHolder types(ft);
if (!m_graph.IsStreet(types))
if (types.GetGeoType() != feature::GEOM_LINE)
return;
double const speed = m_graph.GetSpeed(ft);
if (speed <= 0.0)
return;
ft.ParseGeometry(FeatureType::BEST_GEOMETRY);
@ -267,12 +271,6 @@ void FeaturesRoadGraph::ReconstructPath(RoadPosVectorT const & positions, Route
route.SetGeometry(poly.rbegin(), poly.rend());
}
bool FeaturesRoadGraph::IsStreet(feature::TypesHolder const & types) const
{
return (types.GetGeoType() == feature::GEOM_LINE &&
ftypes::IsStreetChecker::Instance()(types));
}
bool FeaturesRoadGraph::IsOneWay(FeatureType const & ft) const
{
return m_vehicleModel->IsOneWay(ft);

View file

@ -31,7 +31,6 @@ public:
private:
friend class CrossFeaturesLoader;
bool IsStreet(feature::TypesHolder const & types) const;
bool IsOneWay(FeatureType const & ft) const;
double GetSpeed(FeatureType const & ft) const;
void LoadFeature(uint32_t id, FeatureType & ft);

View file

@ -30,9 +30,11 @@ public:
void operator() (FeatureType const & ft)
{
double const speed = m_vehicleModel->GetSpeed(ft);
if (ft.GetFeatureType() != feature::GEOM_LINE)
return;
if (ft.GetFeatureType() != feature::GEOM_LINE || speed <= 0.0)
double const speed = m_vehicleModel->GetSpeed(ft);
if (speed <= 0.0)
return;
ft.ParseGeometry(FeatureType::BEST_GEOMETRY);