forked from organicmaps/organicmaps
Routing short road crash fix.
This commit is contained in:
parent
d613bb21d8
commit
44a8350ed4
2 changed files with 17 additions and 1 deletions
|
@ -316,7 +316,11 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint,
|
|||
Route::TTimes times;
|
||||
vector<m2::PointD> points;
|
||||
|
||||
MakeTurnAnnotation(routingResult, startMapping, delegate, points, turnsDir, times);
|
||||
if (MakeTurnAnnotation(routingResult, startMapping, delegate, points, turnsDir, times) != NoError)
|
||||
{
|
||||
LOG(LWARNING, ("Can't load road path data from disk!"));
|
||||
return RouteNotFound;
|
||||
}
|
||||
|
||||
route.SetGeometry(points.begin(), points.end());
|
||||
route.SetTurnInstructions(turnsDir);
|
||||
|
@ -468,6 +472,10 @@ OsrmRouter::ResultCode OsrmRouter::MakeTurnAnnotation(
|
|||
}
|
||||
}
|
||||
|
||||
// Path found. Points will be replaced by start and end edges points.
|
||||
if (points.size() == 1)
|
||||
points.push_back(points.front());
|
||||
|
||||
if (points.size() < 2)
|
||||
return RouteNotFound;
|
||||
|
||||
|
|
|
@ -15,6 +15,14 @@ namespace
|
|||
MercatorBounds::FromLatLon(19.172889999999998878, 30.473150000000000404), 7250.);
|
||||
}
|
||||
|
||||
UNIT_TEST(MoscowShortRoadUnpacking)
|
||||
{
|
||||
integration::CalculateRouteAndTestRouteLength(
|
||||
integration::GetOsrmComponents(),
|
||||
MercatorBounds::FromLatLon(55.66218, 37.63253), {0., 0.},
|
||||
MercatorBounds::FromLatLon(55.66237, 37.63560), 101.);
|
||||
}
|
||||
|
||||
// Node filtering test. SVO has many restricted service roads that absent in a OSRM index.
|
||||
UNIT_TEST(MoscowToSVOAirport)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue