Skip to content

Commit 2ba136e

Browse files
committed
improved error message if urban density is not enabled when using max_speed_calculator
1 parent 4e7b5d4 commit 2ba136e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/java/com/graphhopper/GraphHopper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,11 @@ protected void prepareImport() {
863863

864864
if (urbanDensityCalculationThreads > 0)
865865
encodedValuesWithProps.put(UrbanDensity.KEY, new PMap());
866-
if (maxSpeedCalculator != null)
866+
if (maxSpeedCalculator != null) {
867+
if (urbanDensityCalculationThreads <= 0)
868+
throw new IllegalArgumentException("For max_speed_calculator the urban density calculation needs to be enabled (e.g. graph.urban_density.threads: 1)");
867869
encodedValuesWithProps.put(MaxSpeedEstimated.KEY, new PMap());
870+
}
868871

869872
Map<String, ImportUnit> activeImportUnits = new LinkedHashMap<>();
870873
ArrayDeque<String> deque = new ArrayDeque<>(encodedValuesWithProps.keySet());

0 commit comments

Comments
 (0)