Skip to content

Commit 294bbc2

Browse files
committed
feat: enable edge-based CH routing algorithm
1 parent 213d927 commit 294bbc2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ors-api/src/test/java/org/heigit/ors/apitests/routing/ResultTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void testSimpleGetRoute() {
222222
.body("any { it.key == 'features' }", is(true))
223223
.body("features[0].containsKey('properties')", is(true))
224224
.body("features[0].properties.containsKey('summary')", is(true))
225-
.body("features[0].properties.summary.distance", is(closeTo(1046.2, 1)))
226-
.body("features[0].properties.summary.duration", is(closeTo(215.0, 1)))
225+
.body("features[0].properties.summary.distance", is(closeTo(1142.9, 1)))
226+
.body("features[0].properties.summary.duration", is(closeTo(255.2, 1)))
227227
.statusCode(200);
228228
}
229229

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ public void setSpeedups(GHRequest req, boolean useCH, boolean useCore, boolean u
925925

926926
ORSGraphHopper gh = profile().getGraphhopper();
927927

928-
useCH = useCH && gh.isCHAvailable(profileNameCH);
928+
useCH = useCH && gh.isCHAvailable(requestProfileName);
929929
useCore = useCore && !useCH && (gh.isCoreAvailable(requestProfileName) || gh.isCoreAvailable(profileNameNoTC));
930930
useALT = useALT && !useCH && !useCore && gh.isLMAvailable(requestProfileName);
931931

@@ -934,8 +934,8 @@ public void setSpeedups(GHRequest req, boolean useCH, boolean useCore, boolean u
934934
req.getHints().putObject(ProfileTools.KEY_LM_DISABLE, !useALT);
935935

936936
if (useCH) {
937-
req.setAlgorithm(Parameters.Algorithms.DIJKSTRA_BI);
938-
req.setProfile(profileNameCH);
937+
// either Dijkstra or AStar is selected downstream depending on whether node- or egde-based CH is being used
938+
req.setAlgorithm("");
939939
}
940940
if (useCore && !gh.isCoreAvailable(requestProfileName) && gh.isCoreAvailable(profileNameNoTC))
941941
// fallback to a core profile without turn costs if one is available

ors-engine/src/main/java/org/heigit/ors/routing/graphhopper/extensions/ORSGraphHopperConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static ORSGraphHopperConfig createGHSettings(ProfileProperties profile, E
128128
List<CHProfile> chProfiles = new ArrayList<>();
129129
String chWeightingsString = StringUtility.trimQuotes(chOpts.getWeightings());
130130
for (String weighting : chWeightingsString.split(","))
131-
chProfiles.add(new CHProfile(ProfileTools.makeProfileName(vehicle, weighting, false)));
131+
chProfiles.add(new CHProfile(ProfileTools.makeProfileName(vehicle, weighting, hasTurnCosts)));
132132
ghConfig.setCHProfiles(chProfiles);
133133
}
134134
}

0 commit comments

Comments
 (0)