|
23 | 23 | import com.graphhopper.routing.RoutingAlgorithm;
|
24 | 24 | import com.graphhopper.routing.ch.PrepareContractionHierarchies;
|
25 | 25 | import com.graphhopper.routing.util.AlgorithmPreparation;
|
26 |
| -import com.graphhopper.routing.util.CarFlagEncoder; |
27 | 26 | import com.graphhopper.routing.util.EncodingManager;
|
| 27 | +import com.graphhopper.routing.util.FlagEncoder; |
28 | 28 | import com.graphhopper.routing.util.NoOpAlgorithmPreparation;
|
29 | 29 | import com.graphhopper.storage.Directory;
|
30 | 30 | import com.graphhopper.storage.Graph;
|
@@ -84,19 +84,20 @@ void start(CmdArgs args) {
|
84 | 84 | throw new IllegalStateException("Cannot load existing levelgraph at " + graphLocation);
|
85 | 85 | // TODO make sure the graph is unprepared!
|
86 | 86 |
|
| 87 | + final FlagEncoder vehicle = encodingManager.getEncoder("CAR"); |
87 | 88 | StopWatch sw = new StopWatch().start();
|
88 | 89 | try {
|
89 | 90 | printGraphDetails(g);
|
90 | 91 | AlgorithmPreparation prepare;
|
91 | 92 | if (doPrepare) {
|
92 |
| - PrepareContractionHierarchies p = new PrepareContractionHierarchies().graph(g); |
| 93 | + PrepareContractionHierarchies p = new PrepareContractionHierarchies().vehicle(vehicle).graph(g); |
93 | 94 | logger.info("nodes:" + g.nodes() + ", edges:" + g.getAllEdges().maxId());
|
94 | 95 | printPreparationDetails(g, p);
|
95 | 96 | prepare = p;
|
96 | 97 | } else {
|
97 | 98 | prepare = new NoOpAlgorithmPreparation() {
|
98 | 99 | @Override public RoutingAlgorithm createAlgo() {
|
99 |
| - return new Dijkstra(_graph, encodingManager.getEncoder("CAR")); |
| 100 | + return new Dijkstra(_graph, vehicle); |
100 | 101 | }
|
101 | 102 | }.graph(g);
|
102 | 103 | }
|
|
0 commit comments