@@ -39,7 +39,7 @@ But we need to decouple requests from each other and therefor we create a very l
39
39
40
40
The virtual nodes and edges have a higher ` int ` ID than ` graph.getNodes() ` or ` allEdges.length() `
41
41
42
- A call ` queryGraph.lookup( allQRs)` will determine the correct node for all ` QueryResult ` s: and either
42
+ A call ` QueryGraph.create(graph, allQRs)` will determine the correct node for all ` QueryResult ` s: and either
43
43
create new virtual nodes or if close enough use the existing junction node.
44
44
45
45
### Create and save the graph
@@ -73,8 +73,7 @@ if (!index.loadExisting())
73
73
``` java
74
74
QueryResult fromQR = index. findClosest(latitudeFrom, longituteFrom, EdgeFilter . ALL_EDGES );
75
75
QueryResult toQR = index. findClosest(latitudeTo, longituteTo, EdgeFilter . ALL_EDGES );
76
- QueryGraph queryGraph = new QueryGraph (graph);
77
- queryGraph. lookup(fromQR, toQR);
76
+ QueryGraph queryGraph = QueryGraph . create(graph, fromQR, toQR);
78
77
Path path = new Dijkstra (queryGraph, encoder). calcPath(fromQR. getClosestNode(), toQR. getClosestNode());
79
78
```
80
79
@@ -100,7 +99,8 @@ EdgeIteratorState edge = graph.edge(fromId, toId);
100
99
101
100
// Prepare the graph for fast querying ...
102
101
TraversalMode tMode = TraversalMode . NODE_BASED ;
103
- PrepareContractionHierarchies pch = new PrepareContractionHierarchies (ghStorage, encoder, weighting, tMode);
102
+ CHConfig chConfig = CHConfig . nodeBased(" chGraphName" , weighting);
103
+ PrepareContractionHierarchies pch = new PrepareContractionHierarchies (ghStorage, chConfig);
104
104
pch. doWork();
105
105
106
106
// flush after preparation!
@@ -117,8 +117,7 @@ if (!index.loadExisting())
117
117
// calculate path is identical
118
118
QueryResult fromQR = index. findClosest(latitudeFrom, longituteFrom, EdgeFilter . ALL_EDGES );
119
119
QueryResult toQR = index. findClosest(latitudeTo, longituteTo, EdgeFilter . ALL_EDGES );
120
- QueryGraph queryGraph = new QueryGraph (graph);
121
- queryGraph. lookup(fromQR, toQR);
120
+ QueryGraph queryGraph = QueryGraph . create(graph, fromQR, toQR);
122
121
123
122
// create the algorithm using the PrepareContractionHierarchies object
124
123
AlgorithmOptions algoOpts = AlgorithmOptions . start().
0 commit comments