Skip to content

Commit 118bb60

Browse files
committed
rename model to bike_avoid_turns.json
1 parent 3b62140 commit 118bb60

5 files changed

Lines changed: 4 additions & 20 deletions

File tree

‎core/src/main/java/com/graphhopper/routing/DefaultWeightingFactory.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ public Weighting createWeighting(Profile profile, PMap requestHints, boolean dis
6262
Weighting weighting = null;
6363
if (CustomWeighting.NAME.equalsIgnoreCase(weightingStr)) {
6464
final CustomModel queryCustomModel = requestHints.getObject(CustomModel.KEY, null);
65-
if (profile.getTurnCostsConfig() != null && !profile.getTurnCostsConfig().isAllowTurnPenaltyInRequest() && queryCustomModel != null && !queryCustomModel.getTurnPenalty().isEmpty())
66-
throw new IllegalArgumentException("The turn_penalty feature is not supported per request for " + profile.getName() + ". Set 'allow_turn_penalty_in_request' to true in the 'turn_costs' option in the config.yml.");
67-
6865
final CustomModel mergedCustomModel = CustomModel.merge(profile.getCustomModel(), queryCustomModel);
6966
if (requestHints.has(Parameters.Routing.HEADING_PENALTY))
7067
mergedCustomModel.setHeadingPenalty(requestHints.getDouble(Parameters.Routing.HEADING_PENALTY, Parameters.Routing.DEFAULT_HEADING_PENALTY));

‎core/src/main/resources/com/graphhopper/custom_models/bike.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// turn_costs:
1212
// vehicle_types: [bicycle]
1313
// u_turn_costs: 10
14-
// custom_model_files: [bike.json, bike_avoid_private.json, avoid_turns.json, bike_elevation.json]
14+
// custom_model_files: [bike.json, bike_avoid_private.json, bike_avoid_turns.json, bike_elevation.json]
1515

1616
{
1717
"priority": [

core/src/main/resources/com/graphhopper/custom_models/avoid_turns.json renamed to core/src/main/resources/com/graphhopper/custom_models/bike_avoid_turns.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
// right:
66
{ "else_if": "change_angle >= 25 && change_angle < 80", "add": "3" },
77
// sharp right:
8-
{ "else_if": "change_angle >= 80 && change_angle <= 180", "add": "3" },
8+
{ "else_if": "change_angle >= 80 && change_angle <= 180", "add": "4" },
99
// left:
1010
{ "else_if": "change_angle <= -25 && change_angle > -80", "add": "3" },
1111
// sharp left:
12-
{ "else_if": "change_angle <= -80 && change_angle >= -180", "add": "3" },
13-
// uTurnCosts:
14-
{ "else": "", "add": "Infinity" }
12+
{ "else_if": "change_angle <= -80 && change_angle >= -180", "add": "4" }
1513
]
1614
}

‎core/src/main/resources/com/graphhopper/custom_models/bike_tc.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// turn_costs:
1212
// vehicle_types: [bicycle]
1313
// u_turn_costs: 20
14-
// custom_model_files: [bike_tc.json, avoid_turns.json, bike_avoid_private.json, bike_elevation.json]
14+
// custom_model_files: [bike_tc.json, bike_avoid_turns.json, bike_avoid_private.json, bike_elevation.json]
1515

1616
{
1717
"priority": [

‎web-api/src/main/java/com/graphhopper/util/TurnCostsConfig.java‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public class TurnCostsConfig {
1111

1212
private int uTurnCosts = INFINITE_U_TURN_COSTS;
1313
private List<String> vehicleTypes;
14-
private boolean allowTurnPenaltyInRequest;
1514

1615
// ensure that no typos can occur like motor_car vs motorcar or bike vs bicycle
1716
private static final Set<String> ALL_SUPPORTED = Set.of(
@@ -79,16 +78,6 @@ public TurnCostsConfig setUTurnCosts(int uTurnCosts) {
7978
return this;
8079
}
8180

82-
@JsonProperty("allow_turn_penalty_in_request")
83-
public boolean isAllowTurnPenaltyInRequest() {
84-
return allowTurnPenaltyInRequest;
85-
}
86-
87-
public TurnCostsConfig setAllowTurnPenaltyInRequest(boolean allowTurnPenaltyInRequest) {
88-
this.allowTurnPenaltyInRequest = allowTurnPenaltyInRequest;
89-
return this;
90-
}
91-
9281
@JsonProperty("u_turn_costs")
9382
public int getUTurnCosts() {
9483
return uTurnCosts;

0 commit comments

Comments
 (0)