Use common function for clamping logic for all user-visible bearings.

This commit is contained in:
Daniel Patterson
2016-12-13 10:44:11 -08:00
committed by Patrick Niklaus
parent 67ce19cb14
commit a51ef67db8
2 changed files with 11 additions and 7 deletions
+5
View File
@@ -40,6 +40,11 @@ util::json::Array coordinateToLonLat(const util::Coordinate coordinate);
std::string modeToString(const extractor::TravelMode mode);
/**
* Ensures that a bearing value is a whole number, and clamped to the range 0-359
*/
inline double roundAndClampBearing(double bearing) { return std::fmod(std::round(bearing), 360); }
} // namespace detail
template <unsigned POLYLINE_PRECISION, typename ForwardIter>