Repository navigation
Choose edge-based CH if it was prepared and the edge_based parameter was not set - #1706
Merged
Merged
Conversation
edge_based parameter was not set
# Conflicts: # core/files/changelog.txt # reader-osm/src/test/java/com/graphhopper/GraphHopperIT.java
karussell
reviewed
Sep 6, 2019
| CH graphs are now identified using CHProfile instead of Weighting, #1670 | ||
| removed the 'traversal_mode` request parameter for /route, instead of 'traversal_mode=edge_based_2dir' use edge_based=true | ||
| removed GraphHopper.set/getTraversalMode() methods, #1705 | ||
| removed the 'traversal_mode` request parameter for /route, instead of 'traversal_mode=edge_based_2dir' use edge_based=true |
Member
There was a problem hiding this comment.
I think this is a merge conflict and duplicated?
karussell
reviewed
Sep 6, 2019
| } else { | ||
| return nodeBasedPCH; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Would it make sense to reduce the nesting a bit? E.g. (or is this then too unreadable?)
if (edgeBased && edgeBasedPCH != null)
return edgeBasedPCH;
if (!edgeBased && nodeBasedPCH != null)
return nodeBasedPCH;
String str = edgeBased?
"Found a node-based CH preparation for weighting map " + map + ", but requested edge-based CH :
"Found an edge-based CH preparation for weighting map " + map + ", but requested node-based CH :
throw new IllegalArgumentException(str + ". You either need to configure edge-based CH preparation or set the '" + Parameters.Routing.EDGE_BASED
+ "' parameter to '"+!edgeBased+"' (was '"+edgeBased+"'). all entries: " + entriesStrs);and
return edgeBasedPCH != null ? edgeBasedPCH : nodeBasedPCH;
Member
Author
There was a problem hiding this comment.
ok yes I did this. there was an error in the error message as well ('need to configure node-based' instead of 'need to configure edge-based' in the second case)
karussell
approved these changes
Sep 6, 2019
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.
This fixes #1637 and is based on #1705.
When we are determining the traversal mode and when the
edge_basedparameter is missing, we check what CH preparations are there (instead of looking at the turn cost support of the encoder as for non-CH).So with this change we do no longer need to set
edge_based=trueto get edge-based CH and instead edge-based CH is picked automatically if it was prepared (if not we fall back to node-based CH). Ifedge_basedis set on the request its value is respected (and there will be an error if the specified preparation is missing).Note that with this PR we now choose edge-based CH when there are node and edge-based CH preparations for the chosen weighting and the
edge_basedparameter was not set.