File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
core/src/main/java/com/graphhopper/routing/ch Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -244,15 +244,22 @@ public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFact
244
244
map .setWeighting (getDefaultWeighting ());
245
245
246
246
boolean edgeBased = map .getBool (Parameters .Routing .EDGE_BASED , false );
247
- String entriesStr = "" ;
247
+ List <String > entriesStrs = new ArrayList <>();
248
+ boolean weightingMatchesButNotEdgeBased = false ;
248
249
for (PrepareContractionHierarchies p : allPreparations ) {
249
- if (p .isEdgeBased () == edgeBased && p .getWeighting ().matches (map ))
250
+ boolean weightingMatches = p .getWeighting ().matches (map );
251
+ if (p .isEdgeBased () == edgeBased && weightingMatches )
250
252
return p ;
253
+ else if (weightingMatches )
254
+ weightingMatchesButNotEdgeBased = true ;
251
255
252
- entriesStr += p .getWeighting () + "|" + (p .isEdgeBased () ? "edge" : "node" ) + ", " ;
256
+ entriesStrs . add ( p .getWeighting () + "|" + (p .isEdgeBased () ? "edge" : "node" )) ;
253
257
}
254
258
255
- throw new IllegalArgumentException ("Cannot find CH RoutingAlgorithmFactory for weighting map " + map + " in entries " + entriesStr );
259
+ String hint = weightingMatchesButNotEdgeBased
260
+ ? " The '" + Parameters .Routing .EDGE_BASED + "' url parameter is missing or does not fit the weightings. Its value was: '" + edgeBased + "'"
261
+ : "" ;
262
+ throw new IllegalArgumentException ("Cannot find CH RoutingAlgorithmFactory for weighting map " + map + " in entries: " + entriesStrs + "." + hint );
256
263
}
257
264
258
265
public int getPreparationThreads () {
You can’t perform that action at this time.
0 commit comments