Skip to content

Commit f6d3f37

Browse files
committed
Update low level docs
1 parent 268ec1d commit f6d3f37

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/core/low-level-api.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ But we need to decouple requests from each other and therefor we create a very l
3939

4040
The virtual nodes and edges have a higher `int` ID than `graph.getNodes()` or `allEdges.length()`
4141

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
4343
create new virtual nodes or if close enough use the existing junction node.
4444

4545
### Create and save the graph
@@ -73,8 +73,7 @@ if (!index.loadExisting())
7373
```java
7474
QueryResult fromQR = index.findClosest(latitudeFrom, longituteFrom, EdgeFilter.ALL_EDGES);
7575
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);
7877
Path path = new Dijkstra(queryGraph, encoder).calcPath(fromQR.getClosestNode(), toQR.getClosestNode());
7978
```
8079

@@ -100,7 +99,8 @@ EdgeIteratorState edge = graph.edge(fromId, toId);
10099

101100
// Prepare the graph for fast querying ...
102101
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);
104104
pch.doWork();
105105

106106
// flush after preparation!
@@ -117,8 +117,7 @@ if (!index.loadExisting())
117117
// calculate path is identical
118118
QueryResult fromQR = index.findClosest(latitudeFrom, longituteFrom, EdgeFilter.ALL_EDGES);
119119
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);
122121

123122
// create the algorithm using the PrepareContractionHierarchies object
124123
AlgorithmOptions algoOpts = AlgorithmOptions.start().

0 commit comments

Comments
 (0)