Skip to content

Commit

Permalink
reintroduce passing graph build date
Browse files Browse the repository at this point in the history
  • Loading branch information
takb committed Mar 1, 2023
1 parent a7c7858 commit 6dbb40b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/src/main/java/com/graphhopper/routing/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ protected GHResponse routeRoundTrip(GHRequest request, FlexSolver solver) {
// we merge the different legs of the roundtrip into one response path
ResponsePath responsePath = concatenatePaths(request, solver.weighting, queryGraph, result.paths, getWaypoints(snaps));
ghRsp.add(responsePath);
// ORS-GH MOD START - pass graph date
String date = ghStorage.getProperties().get("datareader.import.date");
if (Helper.isEmpty(date)) {
date = ghStorage.getProperties().get("datareader.data.date");
}
ghRsp.getHints().putObject("data.date", date);
// ORS-GH MOD END
ghRsp.getHints().putObject("visited_nodes.sum", result.visitedNodes);
ghRsp.getHints().putObject("visited_nodes.average", (float) result.visitedNodes / (snaps.size() - 1));
return ghRsp;
Expand Down Expand Up @@ -278,6 +285,13 @@ protected GHResponse routeAlt(GHRequest request, Solver solver) {
// ORS-GH MOD END
ghRsp.add(responsePath);
}
// ORS-GH MOD START - pass graph date
String date = ghStorage.getProperties().get("datareader.import.date");
if (Helper.isEmpty(date)) {
date = ghStorage.getProperties().get("datareader.data.date");
}
ghRsp.getHints().putObject("data.date", date);
// ORS-GH MOD END
ghRsp.getHints().putObject("visited_nodes.sum", result.visitedNodes);
ghRsp.getHints().putObject("visited_nodes.average", (float) result.visitedNodes / (snaps.size() - 1));
return ghRsp;
Expand Down Expand Up @@ -316,6 +330,13 @@ protected GHResponse routeVia(GHRequest request, Solver solver) {

responsePath.addDebugInfo(result.debug);
ghRsp.add(responsePath);
// ORS-GH MOD START - pass graph date
String date = ghStorage.getProperties().get("datareader.import.date");
if (Helper.isEmpty(date)) {
date = ghStorage.getProperties().get("datareader.data.date");
}
ghRsp.getHints().putObject("data.date", date);
// ORS-GH MOD END
ghRsp.getHints().putObject("visited_nodes.sum", result.visitedNodes);
ghRsp.getHints().putObject("visited_nodes.average", (float) result.visitedNodes / (snaps.size() - 1));
return ghRsp;
Expand Down

0 comments on commit 6dbb40b

Please sign in to comment.