Skip to content

Commit

Permalink
Merge pull request ibi-group#588 from ibi-group/ss01-repair
Browse files Browse the repository at this point in the history
Shared Stops Validator SS_01: only consider stops from feed being checked
  • Loading branch information
miles-grant-ibigroup authored Feb 12, 2024
2 parents a84bdd6 + eed8d91 commit 53dc10a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,19 @@ public void validate() {

// Check for SS_01 (stop id appearing in multiple stop groups).
// Make sure this error is only returned if we are inside the feed that is being checked.
if (seenStopIds.contains(stopId)) {
if (feedId.equals(sharedStopFeedId)) {
Stop syntheticStop = new Stop();
syntheticStop.stop_id = stopId;
if (feedId.equals(sharedStopFeedId)) {
if (seenStopIds.contains(stopId)) {
registerError(stops
.stream()
.filter(stop -> stop.stop_id.equals(stopId))
.findFirst()
.orElse(new Stop()), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS
.orElse(syntheticStop), NewGTFSErrorType.MULTIPLE_SHARED_STOPS_GROUPS
);
} else {
seenStopIds.add(stopId);
}
} else {
seenStopIds.add(stopId);
}

// Check for SS_02 (multiple primary stops per stop group).
Expand Down

0 comments on commit 53dc10a

Please sign in to comment.