use of com.graphhopper.config.CHProfile in project graphhopper by graphhopper.
the class GraphHopperTest method testAStarCHBug.
@ParameterizedTest
@ValueSource(booleans = { true, false })
public void testAStarCHBug(boolean turnCosts) {
final String profile = "car";
final String vehicle = "car";
final String weighting = "fastest";
GraphHopper hopper = new GraphHopper().setGraphHopperLocation(GH_LOCATION).setOSMFile(MOSCOW).setProfiles(new Profile(profile).setVehicle(vehicle).setWeighting(weighting).setTurnCosts(turnCosts));
hopper.getCHPreparationHandler().setCHProfiles(new CHProfile(profile));
hopper.importOrLoad();
GHRequest req = new GHRequest(55.821744463888116, 37.60380604129401, 55.82608197039734, 37.62055856655137);
req.setProfile(profile);
req.getHints().putObject(CH.DISABLE, false);
ResponsePath pathCH = hopper.route(req).getBest();
req.getHints().putObject(CH.DISABLE, true);
ResponsePath path = hopper.route(req).getBest();
assertFalse(path.hasErrors());
assertFalse(pathCH.hasErrors());
assertEquals(path.getDistance(), pathCH.getDistance(), 0.1);
assertEquals(path.getTime(), pathCH.getTime());
}
Aggregations