Skip to content

Commit 48f3d0f

Browse files
author
Hendrik Leuschner
committed
Merge branch 'fix/matrix_load_tests' of https://github.com/GIScience/openrouteservice into fix/matrix_load_tests
2 parents 46341ca + f9e23e3 commit 48f3d0f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Releasing is documented in RELEASE.md
4343
- fix http pooling for matrix generation requests ([#2059](https://github.com/GIScience/openrouteservice/pull/2059))
4444
- bump deprecated CodeQL and failing Grype scan GitHub actions to their current versions ([#2061](https://github.com/GIScience/openrouteservice/pull/2061))
4545
- avoid routing on roads with access reserved to customers ([#2060](https://github.com/GIScience/openrouteservice/pull/2060))
46+
- required dynamic weights for driving-hgv with `hazmat` `false` or other default Vehicle init values ([#2071](https://github.com/GIScience/openrouteservice/pull/2071))
4647

4748
### Security
4849

ors-engine/src/main/java/org/heigit/ors/routing/RouteSearchParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public boolean requiresDynamicPreprocessedWeights() {
319319
|| hasAvoidCountries()
320320
|| getConsiderTurnRestrictions()
321321
|| hasNonDefaultVehicleType()
322-
|| isProfileTypeDriving() && hasParameters(VehicleParameters.class)
322+
|| isProfileTypeDriving() && hasParameters(VehicleParameters.class) && ((VehicleParameters)profileParams).hasAttributes()
323323
|| hasMaximumSpeed()
324324
|| hasFlexibleMode();
325325
}

ors-engine/src/test/java/org/heigit/ors/routing/RouteSearchParametersTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.heigit.ors.routing;
22

33
import org.heigit.ors.routing.graphhopper.extensions.HeavyVehicleAttributes;
4+
import org.heigit.ors.routing.graphhopper.extensions.VehicleLoadCharacteristicsFlags;
45
import org.heigit.ors.routing.parameters.VehicleParameters;
56
import org.heigit.ors.routing.pathprocessors.BordersExtractor;
67
import org.junit.jupiter.api.Test;
@@ -229,6 +230,13 @@ void requiresDynamicPreprocessedWeights() throws Exception {
229230
routeSearchParameters = new RouteSearchParameters();
230231
routeSearchParameters.setProfileType(RoutingProfileType.DRIVING_HGV);
231232
routeSearchParameters.setProfileParams(new VehicleParameters());
233+
assertFalse(routeSearchParameters.requiresDynamicPreprocessedWeights(), "profile param");
234+
235+
routeSearchParameters = new RouteSearchParameters();
236+
routeSearchParameters.setProfileType(RoutingProfileType.DRIVING_HGV);
237+
VehicleParameters vehicleParams = new VehicleParameters();
238+
vehicleParams.setLoadCharacteristics(VehicleLoadCharacteristicsFlags.HAZMAT);
239+
routeSearchParameters.setProfileParams(vehicleParams);
232240
assertTrue(routeSearchParameters.requiresDynamicPreprocessedWeights(), "profile param");
233241
}
234242
}

0 commit comments

Comments
 (0)