Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic updates do not support floats #5079

Closed
danielfdsilva opened this issue May 15, 2018 · 7 comments · Fixed by #6327
Closed

Traffic updates do not support floats #5079

danielfdsilva opened this issue May 15, 2018 · 7 comments · Fixed by #6327

Comments

@danielfdsilva
Copy link

An error is thrown when edge_speed_in_km_h is a float, however float values are allowed through the profile file with forward_speed, backward_speed.

[info] Input file: /data/.tmp/osrm/roadnetwork.osrm
[info] Threads: 4
[info] Reading node weights.
[info] Done reading node weights.
[info] Loading edge-expanded graph representation
TBB Warning: Exact exception propagation is requested by application but the linked library is built without support for it
terminate called after throwing an instance of 'osrm::util::exception'
  what():  CSV file /data/.tmp/speed-upgrade-561634.csv malformed on line 1:
 561635,561636,2.5
include/updater/csv_file_parser.hpp:120include/updater/csv_file_parser.hpp:85
@TheMarex
Copy link
Member

Do you think floating point precision is important for your use-case or would routing fix this?

@danielfdsilva
Copy link
Author

@TheMarex Yes, the precision is important. We're using OSRM in a sort of unconventional way and it makes a difference. I tried to multiply the value by say 1000, so we could discard the decimals, but that gives weird results and the routes picked change. (Any idea why this happens? Is there any speed limit set internally?)
What would your suggestion be regarding routing?

@TheMarex
Copy link
Member

TheMarex commented May 23, 2018

What you could try is to change https://github.com/Project-OSRM/osrm-backend/blob/master/include/updater/source.hpp#L53 to double instead of unsigned. I think that should "just" work.

@oxidase
Copy link
Contributor

oxidase commented May 23, 2018

also a CSV line grammar at https://github.com/Project-OSRM/osrm-backend/blob/master/src/updater/csv_source.cpp#L40 must be changed to

qi::double_ >> -(',' >> (qi::double_ | qi::attr(value_if_blank))));

@danielfdsilva
Copy link
Author

This seems to be working. It is not throwing errors anymore. Thanks @TheMarex @oxidase.
Any chance this will make it into a release soon?

@danpat
Copy link
Member

danpat commented May 31, 2018

@danielfdsilva one reason why simply multiplying by 1000 might not work is because of the other weights associated with the graph - primarily turn costs. Unless you've made extensive changes to the .lua script to disable all these other weighting parts, route selection will not be purely based on your speed data import.

Also note that interanlly, OSRM precision is limited - we only store 0.1 second resolution on any road edge, and 0.1 resolution for turn costs. This is one of the reasons that @TheMarex wondered why decimal precision on speeds matters - OSRM may already not store sufficient precision for your use.

@danielfdsilva
Copy link
Author

@danpat I did heavily modify the lua file, stripping it of almost everything. Ours is a very specific use case, that's why we've these needs.
I checked the docs again and increased the max_speed_for_map_matching and weight_precision. This, together with the floating speeds seems to have done the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants