Skip to content

Commit

Permalink
include route, stop names in regional path results
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Nov 6, 2023
1 parent 9ff82b8 commit d8bc6bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public ArrayList<String[]>[] summarizeIterations(Stat stat) {
int nIterations = iterations.size();
checkState(nIterations > 0, "A path was stored without any iterations");
String waits = null, transfer = null, totalTime = null;
String[] path = routeSequence.detailsWithGtfsIds(transitLayer);
String[] path = routeSequence.detailsWithGtfsIds(transitLayer, true);
double targetValue;
IntStream totalWaits = iterations.stream().mapToInt(i -> i.waitTimes.sum());
if (stat == Stat.MINIMUM) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/conveyal/r5/transit/path/RouteSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public RouteSequence(PatternSequence patternSequence, TransitLayer transitLayer)
}

/** Returns details summarizing this route sequence, using GTFS ids stored in the supplied transitLayer. */
public String[] detailsWithGtfsIds(TransitLayer transitLayer){
public String[] detailsWithGtfsIds(TransitLayer transitLayer, boolean includeNames){
StringJoiner routeIds = new StringJoiner("|");
StringJoiner boardStopIds = new StringJoiner("|");
StringJoiner alightStopIds = new StringJoiner("|");
StringJoiner rideTimes = new StringJoiner("|");
for (int i = 0; i < routes.size(); i++) {
routeIds.add(transitLayer.routeString(routes.get(i), false));
boardStopIds.add(transitLayer.stopString(stopSequence.boardStops.get(i), false));
alightStopIds.add(transitLayer.stopString(stopSequence.alightStops.get(i), false));
routeIds.add(transitLayer.routeString(routes.get(i), includeNames));
boardStopIds.add(transitLayer.stopString(stopSequence.boardStops.get(i), includeNames));
alightStopIds.add(transitLayer.stopString(stopSequence.alightStops.get(i), includeNames));
rideTimes.add(String.format("%.1f", stopSequence.rideTimesSeconds.get(i) / 60f));
}
String accessTime = stopSequence.access == null ? null : String.format("%.1f", stopSequence.access.time / 60f);
Expand Down

0 comments on commit d8bc6bc

Please sign in to comment.