Skip to content

Commit

Permalink
Append feedId values to alighting stops
Browse files Browse the repository at this point in the history
  • Loading branch information
ansoncfit committed Jan 23, 2024
1 parent 584aafa commit 4a5b721
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/conveyal/r5/transit/TransitLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -842,4 +842,8 @@ public String stopString(int stopIndex, boolean includeName) {
if (includeName) stop += " (" + stopNames.get(stopIndex) + ")";
return stop;
}

public String feedFromStop(int stopIndex) {
return stopIdForIndex.get(stopIndex) == null ? "[new]" : stopIdForIndex.get(stopIndex).split(":")[0];
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/conveyal/r5/transit/path/RouteSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public String[] detailsWithGtfsIds(TransitLayer transitLayer){
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));
alightStopIds.add(":");
alightStopIds.add(transitLayer.feedFromStop(stopSequence.boardStops.get(i)));
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 4a5b721

Please sign in to comment.