Conversation
…ter change calcOrientation and related to xAxisAngle
…ngle and return u_turn_costs instead of infinity
karussell
added a commit
that referenced
this pull request
Sep 25, 2024
OlafFlebbeBosch
pushed a commit
to OlafFlebbeBosch/graphhopper
that referenced
this pull request
Oct 14, 2024
6 tasks
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.
Fixes #1590.
Use cases:
sharp_left_turn_costsandsharp_right_turn_coststo very high values.straight_costsgets a value you can avoid dense areas via avoiding too many junctions. As the ETA is unaffected this is similar to a custom model that reducespriorityforurban_density==CITY.Some of the configuration details are stated in core/src/main/resources/com/graphhopper/custom_models/bike_tc.json
Note that there are the following different angles:
+-min_angle=> turn costs isstraight_costs(default is 0)min_turn_angleuntilmin_sharp_angle=> turn costs isleft_turn_costs(default is 0)min_sharp_turn_angleuntilmin_u_turn_angle=> turn costs issharp_left_turn_costs(default is 0)min_u_turn_angle=> turn costs isu_turn_costsNote:
left_turn_costsandright_turn_costsare symmetricmin_turn_angle=25min_sharp_turn_angle=80min_u_turn_angle=180The implementation fills an
orientationencoded value where the forward value stores the orientation of the end segment of the edge and the backward value stores the orientation of the start segment of the edge. With that all turn angles can be calculated. Of course sometimes a "left turn" cannot be detected from the angle alone and topology must be considered but for now this orientation approach works good enough (and the topology approach did not work that well alone when I tried it before).A more sophisticated implementation could also use different turn costs depending on the
countryorroad_classbut this and a request-based customization of the turn costs (moving it into the custom_model) should not be part of this PR.