Merge pull request #176 from bykoianko/turnfix

Enhancement turn generation on a serpentine road.
This commit is contained in:
Lev Dragunov 2015-10-09 17:40:49 +03:00
commit f4082a8ef7
2 changed files with 17 additions and 2 deletions

View file

@ -348,3 +348,18 @@ UNIT_TEST(RussiaMoscowLeningradskiyPrptToTheCenterUTurnTest)
integration::TestTurnCount(route, 2);
integration::GetNthTurn(route, 0).TestValid().TestDirection(TurnDirection::TurnLeft);
}
// Test case: checking that no unnecessary turn on a serpentine road.
// This test was written after reducing factors kMaxPointsCount and kMinDistMeters.
UNIT_TEST(SwitzerlandSamstagernBergstrasseTest)
{
TRouteResult const routeResult = integration::CalculateRoute(
integration::GetOsrmComponents(), MercatorBounds::FromLatLon(47.19300, 8.67568), {0., 0.},
MercatorBounds::FromLatLon(47.19162, 8.67590));
Route const & route = *routeResult.first;
IRouter::ResultCode const result = routeResult.second;
TEST_EQUAL(result, IRouter::NoError, ());
integration::TestTurnCount(route, 0);
}

View file

@ -22,8 +22,8 @@ using namespace routing::turns;
namespace
{
double const kFeaturesNearTurnMeters = 3.0;
size_t constexpr kMaxPointsCount = 7;
double constexpr kMinDistMeters = 300.;
size_t constexpr kMaxPointsCount = 5;
double constexpr kMinDistMeters = 200.;
size_t constexpr kNotSoCloseMaxPointsCount = 3;
double constexpr kNotSoCloseMinDistMeters = 30.;