-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Compute correct speed values in tile plugin #3790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two if
checks still need to be adjusted otherwise good to go. 👍 Could you also write a changelog entry for this bug fix?
@@ -568,14 +596,15 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase & | |||
|
|||
// Calculate the speed for this line | |||
std::uint32_t speed_kmh = | |||
static_cast<std::uint32_t>(round(length / reverse_weight * 10 * 3.6)); | |||
static_cast<std::uint32_t>(round(length / reverse_duration * 10 * 3.6)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If statement above needs to be adjusted as well, it check for zero division.
@@ -544,14 +571,15 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase & | |||
|
|||
// Calculate the speed for this line | |||
std::uint32_t speed_kmh = | |||
static_cast<std::uint32_t>(round(length / forward_weight * 10 * 3.6)); | |||
static_cast<std::uint32_t>(round(length / forward_duration * 10 * 3.6)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If statement above needs to be adjusted as well, it check for zero division.
Issue
In #2399 tile plugin was not adjusted and returned weight-based speed values that look misleading if profile weight is not duration.
PR fixes speed to be
distance / duration
, addsweight
feature and fixes turn durations./cc @TheMarex
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?