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:
committed by
Daniel Patterson
parent
f7e8581a1b
commit
15c8fd326f
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user