Merge pull request #3360 from bykoianko/master-assert-in-case-long-bicycle-routes

Fixing asserts while generating turns for long routes.
This commit is contained in:
ygorshenin 2016-05-27 16:50:40 +03:00
commit 2a1b48ae4a
2 changed files with 11 additions and 4 deletions

View file

@ -36,8 +36,8 @@ public:
// turns::IRoutingResult overrides:
TUnpackedPathSegments const & GetSegments() const override { return m_pathSegments; }
void GetPossibleTurns(TNodeId node, m2::PointD const & ingoingPoint,
m2::PointD const & junctionPoint, size_t & ingoingCount,
void GetPossibleTurns(TNodeId node, m2::PointD const & /* ingoingPoint */,
m2::PointD const & /* junctionPoint */, size_t & ingoingCount,
TurnCandidates & outgoingTurns) const override
{
ingoingCount = 0;
@ -51,7 +51,7 @@ public:
}
ingoingCount = adjacentEdges->second.m_ingoingTurnsCount;
outgoingTurns.candidates = adjacentEdges->second.m_outgoingTurns.candidates;
outgoingTurns = adjacentEdges->second.m_outgoingTurns;
}
double GetPathLength() const override { return m_routeLength; }

View file

@ -11,5 +11,12 @@ UNIT_TEST(RussiaMoscowSevTushinoParkPreferingBicycleWay)
{
integration::CalculateRouteAndTestRouteLength(
integration::GetBicycleComponents(), MercatorBounds::FromLatLon(55.87445, 37.43711), {0., 0.},
MercatorBounds::FromLatLon(55.87203, 37.44274), 460.);
MercatorBounds::FromLatLon(55.87203, 37.44274), 460.0);
}
UNIT_TEST(RussiaMoscowNahimovskyLongRoute)
{
integration::CalculateRouteAndTestRouteLength(
integration::GetBicycleComponents(), MercatorBounds::FromLatLon(55.66151, 37.63320), {0., 0.},
MercatorBounds::FromLatLon(55.67695, 37.56220), 6938.0);
}