Skip to content

Commit

Permalink
ignoring stoptimes for trips with location id and location group
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgamez committed Oct 17, 2024
1 parent 3fa0c2f commit 0a5a90e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ public class StopTimeIncreasingDistanceValidator extends FileValidator {
@Override
public void validate(NoticeContainer noticeContainer) {
for (List<GtfsStopTime> stopTimeList : Multimaps.asMap(stopTimeTable.byTripIdMap()).values()) {
// DecreasingOrEqualStopTimeDistanceNotice should not be triggered in cases where stop
// times has location id, location group id or stop id is not present
// See: https://github.com/MobilityData/gtfs-validator/issues/1882
if (stopTimeList.stream()
.anyMatch(
stopTime ->
!stopTime.hasStopId()
|| stopTime.hasLocationId()
|| stopTime.hasLocationGroupId())) {
continue;
}
// GtfsStopTime objects are sorted based on @SequenceKey annotation on stop_sequence field.
for (int i = 1; i < stopTimeList.size(); ++i) {
GtfsStopTime prev = stopTimeList.get(i - 1);
Expand Down

0 comments on commit 0a5a90e

Please sign in to comment.