File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
main/java/com/graphhopper/storage
test/java/com/graphhopper/storage Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -282,12 +282,6 @@ private void checkIfConfiguredAndLoadedWeightingsCompatible() {
282
282
String loadedStr = properties .get ("graph.ch.profiles" );
283
283
List <String > loaded = parseList (loadedStr );
284
284
List <CHProfile > configured = getCHProfiles ();
285
- // todo: not entirely sure here. when no ch is configured at all (neither edge nor node), but there are any
286
- // ch graphs (edge or node) we throw an error ? previously we threw an error when no ch weighting was configured
287
- // even though there was a ch graph.
288
- if (configured .isEmpty () && !loaded .isEmpty ()) {
289
- throw new IllegalStateException ("You loaded a CH graph, but you did not specify any CH weightings in prepare.ch.weightings" );
290
- }
291
285
for (CHProfile chProfile : configured ) {
292
286
if (!loaded .contains (chProfile .toString ())) {
293
287
throw new IllegalStateException ("Configured CH profile: " + chProfile .toString () + " is not contained in loaded weightings for CH" + loadedStr + ".\n " +
Original file line number Diff line number Diff line change @@ -592,6 +592,13 @@ private void testLoadingWithLessWeightings_works(boolean edgeBased) {
592
592
assertEquals (edgeBased ? 1 : 0 , smallStorage .getCHProfiles (true ).size ());
593
593
smallStorage .flush ();
594
594
595
+ // now we create a new storage without any ch weightings, which should also be ok
596
+ GraphHopperStorage smallerStorage = createStorageWithWeightings ();
597
+ smallerStorage .loadExisting ();
598
+ assertEquals (0 , smallerStorage .getCHProfiles (false ).size ());
599
+ assertEquals (0 , smallerStorage .getCHProfiles (true ).size ());
600
+ smallerStorage .flush ();
601
+
595
602
// now we create yet another storage that uses both weightings again, which still works
596
603
GraphHopperStorage fullStorage = createStorageWithWeightings (
597
604
"car|fastest|" + edgeOrNode ,
You can’t perform that action at this time.
0 commit comments