Skip to content

Commit

Permalink
Update documentation regarding usage of EncodingManager's constructor (
Browse files Browse the repository at this point in the history
…#1594)

The constructor is private and you have to use the factory methods.
  • Loading branch information
Nakaner authored and karussell committed Apr 8, 2019
1 parent 06f0010 commit f748ab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/core/low-level-api.md
Expand Up @@ -46,7 +46,7 @@ create new virtual nodes or if close enough use the existing junction node.

```java
FlagEncoder encoder = new CarFlagEncoder();
EncodingManager em = new EncodingManager(encoder);
EncodingManager em = EncodingManager.create(encoder);
GraphBuilder gb = new GraphBuilder(em).setLocation("graphhopper_folder").setStore(true);
GraphStorage graph = gb.create();
// Make a weighted edge between two nodes.
Expand Down
6 changes: 3 additions & 3 deletions docs/core/routing.md
Expand Up @@ -11,7 +11,7 @@ GraphHopper hopper = new GraphHopperOSM().forServer();
hopper.setDataReaderFile(osmFile);
// where to store graphhopper files?
hopper.setGraphHopperLocation(graphFolder);
hopper.setEncodingManager(new EncodingManager("car"));
hopper.setEncodingManager(EncodingManager.create("car"));

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

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

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

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

hopper.importOrLoad();

Expand Down

0 comments on commit f748ab2

Please sign in to comment.