Remove assertions that could be triggered by bad data. (#3469)

When two consecutive nodes have identical coordinates, there is no valid
bearing.  For now, make equal nodes have bearing 0.

Full fix still needs to be done via https://github.com/Project-OSRM/osrm-backend/issues/3470.
This commit is contained in:
Moritz Kobitzsch
2017-01-07 02:10:02 +01:00
committed by Daniel Patterson
parent f7e8581a1b
commit 15c8fd326f
9 changed files with 132 additions and 42 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(test_tile)
const auto rc = osrm.Tile(params, result);
BOOST_CHECK(rc == Status::Ok);
BOOST_CHECK_EQUAL(result.size(), 114091);
BOOST_CHECK_EQUAL(result.size(), 114098);
protozero::pbf_reader tile_message(result);
tile_message.next();
@@ -378,4 +378,15 @@ BOOST_AUTO_TEST_CASE(parallel_lines_slight_offset)
BOOST_CHECK(are_parallel);
}
BOOST_AUTO_TEST_CASE(consistent_invalid_bearing_result)
{
const auto pos1 = Coordinate(util::FloatLongitude{0.}, util::FloatLatitude{0.});
const auto pos2 = Coordinate(util::FloatLongitude{5.}, util::FloatLatitude{5.});
const auto pos3 = Coordinate(util::FloatLongitude{-5.}, util::FloatLatitude{-5.});
BOOST_CHECK_EQUAL(0., util::coordinate_calculation::bearing(pos1, pos1));
BOOST_CHECK_EQUAL(0., util::coordinate_calculation::bearing(pos2, pos2));
BOOST_CHECK_EQUAL(0., util::coordinate_calculation::bearing(pos3, pos3));
}
BOOST_AUTO_TEST_SUITE_END()