Repository navigation
Conversation
MapdOut gains isForward, so consumers can tell which direction the current way match is traveled in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"mapdOut" has "wayId", but nothing says which way along that road the car is going. Two-way roads often have a different limit in each direction ("maxspeed:forward" and "maxspeed:backward"), and mapd already handles that internally with "OnWay.IsForward", but a fork that wants to remember or look up something per road direction can't tell the two apart from "wayId" alone.
This adds "isForward" to "MapdOut", set from "CurrentWay.OnWay.IsForward". It's true when the car is travelling in the order the way's nodes are stored, the same direction "maxspeed:forward" refers to.
Audit report
Why it's needed
Anything downstream that stores or looks up data per road direction needs it, like a fork that learns or caches speed limits per road, or a UI that shows something different for each direction. Without the field both directions share one entry, so a value seen going one way gets used going the other. FrogPilot is one example. It keys its speed limit data on "(wayId, isForward)", and it has been running this exact change on its devices since October.
Change
Testing