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
+5
View File
@@ -145,6 +145,11 @@ double bearing(const Coordinate first_coordinate, const Coordinate second_coordi
{
result -= 360.0;
}
// If someone gives us two identical coordinates, then the concept of a bearing
// makes no sense. However, because it sometimes happens, we'll at least
// return a consistent value of 0 so that the behaviour isn't random.
BOOST_ASSERT(first_coordinate != second_coordinate || result == 0.);
return result;
}