Skip to content

Commit

Permalink
Merge pull request #1053 from GIScience/bugfix#1047-core_node_check_f…
Browse files Browse the repository at this point in the history
…or_virtual_nodes

Check for virtual node before querying node's level
  • Loading branch information
takb authored Sep 1, 2021
2 parents 6530720 + 07ba29d commit d28b697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RELEASING:
- `ORS_APP_CONF` environment variable ([#1017](https://github.com/GIScience/openrouteservice/issues/1017))
### Fixed
- Errors in travel speed explanation
- Failing assertion with CALT routing ([#1047](https://github.com/GIScience/openrouteservice/issues/1047))
- Improve travel time estimation for ferry routes ([#1037](https://github.com/GIScience/openrouteservice/issues/1037))

## [6.6.1] - 2021-07-05
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ public AbstractCoreRoutingAlgorithm(Graph graph, Weighting weighting) {
int size = Math.min(2000, Math.max(200, graph.getNodes() / 10));
initCollections(size);

chGraph = (CHGraph) ((QueryGraph) graph).getMainGraph();
qGraph = (QueryGraph) graph;
chGraph = (CHGraph) qGraph.getMainGraph();
coreNodeLevel = chGraph.getNodes() + 1;
turnRestrictedNodeLevel = coreNodeLevel + 1;
}

protected abstract void initCollections(int size);
protected PathBidirRef bestPath;

QueryGraph qGraph;
CHGraph chGraph;
protected final int coreNodeLevel;
protected final int turnRestrictedNodeLevel;
Expand Down Expand Up @@ -200,7 +202,7 @@ void updateBestPath(SPTEntry entryCurrent, SPTEntry entryOther, double newWeight
}

boolean isCoreNode(int node) {
return chGraph.getLevel(node) >= coreNodeLevel;
return !qGraph.isVirtualNode(node) && chGraph.getLevel(node) >= coreNodeLevel;
}

boolean isTurnRestrictedNode(int node) {
Expand Down

0 comments on commit d28b697

Please sign in to comment.