From cf309c407cd1a0ae3be44ce6194b2c87918bec74 Mon Sep 17 00:00:00 2001 From: easbar Date: Tue, 22 Oct 2019 08:21:04 +0200 Subject: [PATCH] Adjust signature of GraphHopper#createTurnWeighting --- core/src/main/java/com/graphhopper/GraphHopper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/graphhopper/GraphHopper.java b/core/src/main/java/com/graphhopper/GraphHopper.java index 2ac02c1fe87..6fe0371502e 100644 --- a/core/src/main/java/com/graphhopper/GraphHopper.java +++ b/core/src/main/java/com/graphhopper/GraphHopper.java @@ -935,10 +935,10 @@ public Weighting createWeighting(HintsMap hintsMap, FlagEncoder encoder, Graph g /** * Potentially wraps the specified weighting into a TurnWeighting instance. */ - public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode, double uTurnCosts) { + public Weighting createTurnWeighting(Weighting weighting, TurnCostExtension turnCostExtension, TraversalMode tMode, double uTurnCosts) { FlagEncoder encoder = weighting.getFlagEncoder(); if (encoder.supports(TurnWeighting.class) && tMode.isEdgeBased()) - return new TurnWeighting(weighting, (TurnCostExtension) graph.getExtension(), uTurnCosts); + return new TurnWeighting(weighting, turnCostExtension, uTurnCosts); return weighting; } @@ -1062,7 +1062,7 @@ else if (ALT_ROUTE.equalsIgnoreCase(algoStr)) throw new IllegalArgumentException("Finite u-turn costs can only be used for edge-based routing, use `" + Routing.EDGE_BASED + "=true'"); } double uTurnCosts = uTurnCostInt == INFINITE_U_TURN_COSTS ? Double.POSITIVE_INFINITY : uTurnCostInt; - weighting = createTurnWeighting(queryGraph, weighting, tMode, uTurnCosts); + weighting = createTurnWeighting(weighting, (TurnCostExtension) queryGraph.getExtension(), tMode, uTurnCosts); AlgorithmOptions algoOpts = AlgorithmOptions.start(). algorithm(algoStr).traversalMode(tMode).weighting(weighting).