Skip to content

Commit f748ab2

Browse files
Nakanerkarussell
authored andcommitted
Update documentation regarding usage of EncodingManager's constructor (graphhopper#1594)
The constructor is private and you have to use the factory methods.
1 parent 06f0010 commit f748ab2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/core/low-level-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ create new virtual nodes or if close enough use the existing junction node.
4646

4747
```java
4848
FlagEncoder encoder = new CarFlagEncoder();
49-
EncodingManager em = new EncodingManager(encoder);
49+
EncodingManager em = EncodingManager.create(encoder);
5050
GraphBuilder gb = new GraphBuilder(em).setLocation("graphhopper_folder").setStore(true);
5151
GraphStorage graph = gb.create();
5252
// Make a weighted edge between two nodes.

docs/core/routing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GraphHopper hopper = new GraphHopperOSM().forServer();
1111
hopper.setDataReaderFile(osmFile);
1212
// where to store graphhopper files?
1313
hopper.setGraphHopperLocation(graphFolder);
14-
hopper.setEncodingManager(new EncodingManager("car"));
14+
hopper.setEncodingManager(EncodingManager.create("car"));
1515

1616
// now this can take minutes if it imports or a few seconds for loading
1717
// of course this is dependent on the area you import
@@ -60,7 +60,7 @@ config.yml `prepare.ch.weightings=no`) or on a per request base by adding `ch.di
6060
(see config.yml `prepare.lm.weightings=fastest`).
6161

6262
If you need multiple vehicle profiles you can specify a list of vehicle profiles (see
63-
config.yml e.g. `graph.flag_encoders=car,bike` or use `new EncodingManager("car,bike")`).
63+
config.yml e.g. `graph.flag_encoders=car,bike` or use `EncodingManager.create("car,bike")`).
6464

6565
To calculate a route you have to pick one vehicle and optionally an algorithm like `bidirectional_astar`:
6666

@@ -69,7 +69,7 @@ GraphHopper hopper = new GraphHopperOSM().forServer();
6969
hopper.setCHEnabled(false);
7070
hopper.setOSMFile(osmFile);
7171
hopper.setGraphHopperLocation(graphFolder);
72-
hopper.setEncodingManager(new EncodingManager("car,bike"));
72+
hopper.setEncodingManager(EncodingManager.create("car,bike"));
7373

7474
hopper.importOrLoad();
7575

0 commit comments

Comments
 (0)