@@ -201,25 +201,25 @@ public MatrixResult computeMatrix(RoutingProfile routingProfile) throws Exceptio
201
201
String encoderName = RoutingProfileType .getEncoderName (getProfileType ());
202
202
FlagEncoder flagEncoder = gh .getEncodingManager ().getEncoder (encoderName );
203
203
PMap hintsMap = new PMap ();
204
+ boolean hasTurnCosts = Boolean .TRUE .equals (routingProfile .getProfileProperties ().getBuild ().getEncoderOptions ().getTurnCosts ());
204
205
ProfileTools .setWeightingMethod (hintsMap , getWeightingMethodOrDefault (), getProfileType (), false );
205
206
ProfileTools .setWeighting (hintsMap , getWeightingMethodOrDefault (), getProfileType (), false );
206
- String chProfileName = ProfileTools .makeProfileName (encoderName , hintsMap .getString ("weighting" , "" ), false );
207
- String coreProfileName = ProfileTools .makeProfileName (encoderName , hintsMap .getString ("weighting" , "" ), true );
207
+ String profileName = ProfileTools .makeProfileName (encoderName , hintsMap .getString ("weighting" , "" ), hasTurnCosts );
208
208
209
209
//TODO Refactoring : probably remove MatrixAlgorithmFactory alltogether as the checks for algorithm choice have to be performed here again. Or combine in a single check nicely
210
210
try {
211
211
// RPHAST
212
- if (!getFlexibleMode () && gh .getCHPreparationHandler ().isEnabled () && routingProfile .hasCHProfile (chProfileName )) {
213
- return computeRPHASTMatrix (gh , flagEncoder , chProfileName );
212
+ if (!getFlexibleMode () && gh .getCHPreparationHandler ().isEnabled () && routingProfile .hasCHProfile (profileName )) {
213
+ return computeRPHASTMatrix (gh , flagEncoder , profileName );
214
214
}
215
215
// Core
216
- else if (getSearchParameters ().getDynamicSpeeds () && routingProfile .getGraphhopper ().isCoreAvailable (coreProfileName )) {
217
- return computeCoreMatrix (gh , flagEncoder , hintsMap , coreProfileName , routingProfile );
216
+ else if (getSearchParameters ().getDynamicSpeeds () && routingProfile .getGraphhopper ().isCoreAvailable (profileName )) {
217
+ return computeCoreMatrix (gh , flagEncoder , hintsMap , profileName , routingProfile );
218
218
}
219
219
// Dijkstra
220
220
else {
221
221
// use CHProfileName (w/o turn costs) since Dijkstra is node-based so turn restrictions are not used.
222
- return computeDijkstraMatrix (gh , flagEncoder , hintsMap , chProfileName );
222
+ return computeDijkstraMatrix (gh , flagEncoder , hintsMap , profileName . replace ( "_with_turn_costs" , "" ) );
223
223
}
224
224
} catch (PointNotFoundException e ) {
225
225
throw e ;
0 commit comments