diff --git a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeIncreasingDistanceValidator.java b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeIncreasingDistanceValidator.java index f6ccf8b2ea..0d412f72bf 100644 --- a/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeIncreasingDistanceValidator.java +++ b/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeIncreasingDistanceValidator.java @@ -47,6 +47,17 @@ public class StopTimeIncreasingDistanceValidator extends FileValidator { @Override public void validate(NoticeContainer noticeContainer) { for (List 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);