We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57d93fc commit b5c10b1Copy full SHA for b5c10b1
include/engine/api/route_api.hpp
@@ -19,6 +19,7 @@
19
20
#include "util/coordinate.hpp"
21
#include "util/integer_range.hpp"
22
+#include "util/json_util.hpp"
23
24
#include <iterator>
25
#include <vector>
@@ -249,7 +250,8 @@ class RouteAPI : public BaseAPI
249
250
{
251
annotation.values["speed"] = GetAnnotations(
252
leg_geometry, [](const guidance::LegGeometry::Annotation &anno) {
- return std::round(anno.distance / anno.duration * 10.) / 10.;
253
+ auto val = std::round(anno.distance / anno.duration * 10.) / 10.;
254
+ return util::json::clamp_float(val);
255
});
256
}
257
0 commit comments