diff --git a/CHANGELOG.md b/CHANGELOG.md index cc561bbb7..a407a52c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - NodeJS: - FIXED: Support `skip_waypoints` in Node bindings [#6060](https://github.com/Project-OSRM/osrm-backend/pull/6060) - Misc: + - ADDED: Support floats for speed value in traffic updates CSV. [#6327](https://github.com/Project-OSRM/osrm-backend/pull/6327) - CHANGED: missing files list is included in exception message. [#5360](https://github.com/Project-OSRM/osrm-backend/pull/5360) - CHANGED: Do not use deprecated Callback::Call overload in Node bindings. [#6318](https://github.com/Project-OSRM/osrm-backend/pull/6318) - FIXED: Fix distance calculation consistency. [#6315](https://github.com/Project-OSRM/osrm-backend/pull/6315) diff --git a/features/testbot/weight.feature b/features/testbot/weight.feature index 5d8aadee3..5d76fd4aa 100644 --- a/features/testbot/weight.feature +++ b/features/testbot/weight.feature @@ -329,7 +329,7 @@ Feature: Weight tests | ce | And the speed file """ - 1,2,36,42 + 1,2,36.999,42 2,1,36,42 """ And the turn penalty file @@ -341,8 +341,8 @@ Feature: Weight tests When I route I should get | waypoints | route | distance | weights | times | - | a,d | , | 60m | 20.5,0 | 24s,0s | - | a,e | ,, | 60m | 27.2,10,0 | 38.5s,11s,0s | + | a,d | , | 60m | 20.5,0 | 23.9s,0s | + | a,e | ,, | 60m | 27.2,10,0 | 38.4s,11s,0s | | d,e | ,, | 40m | 10,10,0 | 11s,11s,0s | @traffic @speed diff --git a/include/updater/source.hpp b/include/updater/source.hpp index 58a19e080..b00d402c9 100644 --- a/include/updater/source.hpp +++ b/include/updater/source.hpp @@ -49,8 +49,8 @@ struct Segment final struct SpeedSource final { - SpeedSource() : speed(0), rate() {} - unsigned speed; + SpeedSource() : speed(0.), rate() {} + double speed; boost::optional rate; std::uint8_t source; }; diff --git a/src/updater/csv_source.cpp b/src/updater/csv_source.cpp index a242a0c66..0f6f12237 100644 --- a/src/updater/csv_source.cpp +++ b/src/updater/csv_source.cpp @@ -37,7 +37,7 @@ SegmentLookupTable readSegmentValues(const std::vector &paths) CSVFilesParser parser( 1, qi::ulong_long >> ',' >> qi::ulong_long, - qi::uint_ >> -(',' >> (qi::double_ | qi::attr(value_if_blank)))); + qi::double_ >> -(',' >> (qi::double_ | qi::attr(value_if_blank)))); // Check consistency of keys in the result lookup table auto result = parser(paths);