Skip to content

Commit b1f2bd7

Browse files
committed
use custom_models.directory consistent naming regarding custom_areas.directory
1 parent de69896 commit b1f2bd7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

config-example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ graphhopper:
2323
# - u_turn_costs: 60 (time-penalty for doing a u-turn in seconds (only possible when `turn_costs: true`)).
2424
# Note that since the u-turn costs are given in seconds the weighting you use should also calculate the weight
2525
# in seconds, so for example it does not work with shortest weighting.
26-
# - custom_model_file: when you specified "weighting: custom" you need to set a json file inside your custom_model_folder
26+
# - custom_model_file: when you specified "weighting: custom" you need to set a json file inside your custom_models.directory
2727
# or working directory that defines the custom_model. If you want an empty model you can also set "custom_model_file: empty".
2828
# You can also use th e`custom_model` field instead and specify your custom model in the profile directly.
2929
#
@@ -47,7 +47,7 @@ graphhopper:
4747
# custom_model_file: bike2.json
4848

4949
# specify the folder where to find the custom model files
50-
custom_model_folder: custom_models
50+
custom_models.directory: custom_models
5151

5252
# Speed mode:
5353
# Its possible to speed up routing by doing a special graph preparation (Contraction Hierarchies, CH). This requires

docs/core/profiles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ profiles:
8383
The name and vehicle fields are the same as for standard profiles and the vehicle field is used as the 'base' vehicle
8484
for the custom profile. The weighting must be always set to `custom` for custom profiles. The custom model itself goes
8585
into the `custom_model` property. Alternatively, you can also set a path to a custom model file using the
86-
`custom_model_folder` and `custom_model_file` properties.
86+
`custom_models.directory` and `custom_model_file` properties.
8787

8888
Using custom profiles for your routing requests works just the same way as for standard profiles. Simply add
8989
`profile=my_custom_profile` as request parameter to your routing request.

web-bundle/src/main/java/com/graphhopper/http/GraphHopperManaged.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public GraphHopperManaged(GraphHopperConfig configuration) {
5858

5959
String customAreasDirectory = configuration.getString("custom_areas.directory", "");
6060
JsonFeatureCollection globalAreas = resolveCustomAreas(customAreasDirectory);
61-
String customModelFolder = configuration.getString("custom_model_folder", "");
61+
String customModelFolder = configuration.getString("custom_models.directory", configuration.getString("custom_model_folder", ""));
6262
List<Profile> newProfiles = resolveCustomModelFiles(customModelFolder, configuration.getProfiles(), globalAreas);
6363
configuration.setProfiles(newProfiles);
6464

@@ -111,7 +111,7 @@ public static List<Profile> resolveCustomModelFiles(String customModelFolder, Li
111111
newProfiles.add(new CustomProfile(profile).setCustomModel(customModel = new CustomModel()));
112112
else {
113113
if (customModelFileName.contains(File.separator))
114-
throw new IllegalArgumentException("Use custom_model_folder for the custom_model_file parent");
114+
throw new IllegalArgumentException("Use custom_models.directory for the custom_model_file parent");
115115
if (!customModelFileName.endsWith(".json"))
116116
throw new IllegalArgumentException("Yaml is no longer supported, see #2672. Use JSON with optional comments //");
117117
try {

web/src/test/java/com/graphhopper/application/resources/RouteResourceCustomModelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private static GraphHopperServerConfiguration createConfig() {
6363
putObject("datareader.file", "../core/files/north-bayreuth.osm.gz").
6464
putObject("graph.location", DIR).
6565
putObject("graph.encoded_values", "max_height,max_weight,max_width,hazmat,toll,surface,track_type,hgv").
66-
putObject("custom_model_folder", "./src/test/resources/com/graphhopper/application/resources").
66+
putObject("custom_models.directory", "./src/test/resources/com/graphhopper/application/resources").
6767
putObject("custom_areas.directory", "./src/test/resources/com/graphhopper/application/resources/areas").
6868
putObject("import.osm.ignored_highways", "").
6969
setProfiles(Arrays.asList(

web/src/test/java/com/graphhopper/application/resources/RouteResourceTruckTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private static GraphHopperServerConfiguration createConfig() {
3636
putObject("graph.location", DIR).
3737
putObject("graph.encoded_values", "max_height,max_weight,max_width,hazmat,toll,surface,hgv").
3838
putObject("import.osm.ignored_highways", "").
39-
putObject("custom_model_folder", "./src/test/resources/com/graphhopper/application/resources").
39+
putObject("custom_models.directory", "./src/test/resources/com/graphhopper/application/resources").
4040
setProfiles(Arrays.asList(new CustomProfile("truck").setVehicle("roads").putHint("custom_model_file", "truck.json"))).
4141
setCHProfiles(Arrays.asList(new CHProfile("truck")));
4242
return config;

0 commit comments

Comments
 (0)