Repository navigation
Move curvature EncodedValue out of MotorcycleTagParser - #2665
Merged
Merged
Conversation
Member
|
Nice! I did not look at the exact modeling of the curvature EV, but the code changes LGTM. |
This branch was previously deployed
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.
I kept the meaning of the curvature value but instead of
(beeline/edge_distance)²it is now onlybeeline/edge_distanceas it did not make a big difference (sure, the small deviations from 1 will be "earlier snap to 0.95", but in practise this didn't matter in my simple tests and having a simpler formula was preferable).If you want to use
curvatureto prefer curves then do not overdo it and something like this is sufficient:{ "priority": [{ "if": "curvature > 0.9", "multiply_by": "0.3" }]}Otherwise, without proper turn costs, you'll see things like:
I tried to calculate some kind of a
max_curvevalue instead as the curvature was sometimes a bit too similar to 1 and used the maximum orientation change of the PointList like:But at the end it did not properly show when a road was curvy (even sometimes not for serpentines). Probably because a curvy road in OSM is often mapped smooth leading to relative small orientation changes. Of course this could happen with the curvature too if multiple ways are created but often this is not the case and of course we would need another feature like "turning angle" to complement this. A good test route for this was here.