if (stopTimeUpdate.hasStopId()) {
if (update.hasStopSequence()) { match = update.getStopSequence() == newTimes.getStopSequence(i); } else if (update.hasStopId()) { match = pattern.getStop(i).getId().getId().equals(update.getStopId());
/** * Checks E037 - if the provided previousStopId value is the same as the current stopTimeUpdate stop_id it adds * an error to the provided error list. * * @param entity entity that the stopTimeUpdate is from * @param previousStopId the stop_id for the previous StopTimeUpdate * @param stopTimeUpdate the current stopTimeUpdate * @param errors the list to add the errors to */ private void checkE037(GtfsRealtime.FeedEntity entity, String previousStopId, GtfsRealtime.TripUpdate.StopTimeUpdate stopTimeUpdate, List<OccurrenceModel> errors) { if (!previousStopId.isEmpty() && stopTimeUpdate.hasStopId() && previousStopId.equals(stopTimeUpdate.getStopId())) { String id = GtfsUtils.getTripId(entity, entity.getTripUpdate()); StringBuilder prefix = new StringBuilder(); prefix.append(id); prefix.append(" has repeating stop_id "); prefix.append(previousStopId); if (stopTimeUpdate.hasStopSequence()) { prefix.append(" at stop_sequence "); prefix.append(stopTimeUpdate.getStopSequence()); } RuleUtils.addOccurrence(ValidationRules.E037, prefix.toString(), errors, _log); } }
List<GtfsRealtime.TripUpdate.StopTimeUpdate> stopTimeUpdateList = tripUpdate.getStopTimeUpdateList(); for (GtfsRealtime.TripUpdate.StopTimeUpdate stopTimeUpdate : stopTimeUpdateList) { if (stopTimeUpdate.hasStopId()) { String prefix = "trip_id " + tripUpdate.getTrip().getTripId() + " stop_id " + stopTimeUpdate.getStopId(); if (!gtfsMetadata.getStopIds().contains(stopTimeUpdate.getStopId())) {
stum.setStopSequence(stu.getStopSequence()); if (stu.hasStopId()) { stum.setStopId(stu.getStopId());
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other) { if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance()) return this; if (other.hasStopSequence()) { setStopSequence(other.getStopSequence()); } if (other.hasStopId()) { bitField0_ |= 0x00000002; stopId_ = other.stopId_; onChanged(); } if (other.hasArrival()) { mergeArrival(other.getArrival()); } if (other.hasDeparture()) { mergeDeparture(other.getDeparture()); } if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship()); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * Checks E045 "GTFS-rt stop_time_update stop_sequence and stop_id do not match GTFS", and adds any errors to the provided error list. * * @param entity entity that the trip_update is from * @param tripUpdate the trip_update to examine * @param stopTimeUpdate the stop_time_update to examine * @param gtfsStopSequence the stop_sequence from the GTFS stop_times.txt data * @param stop the GTFS stop that is paired with the provided gtfsStopSequence, using stop_id from the same record in stop_times.txt * @param errors the list to add the errors to */ private void checkE045(GtfsRealtime.FeedEntity entity, GtfsRealtime.TripUpdate tripUpdate, GtfsRealtime.TripUpdate.StopTimeUpdate stopTimeUpdate, int gtfsStopSequence, Stop stop, List<OccurrenceModel> errors) { if (stopTimeUpdate.hasStopId() && !stop.getId().getId().equals(stopTimeUpdate.getStopId())) { String tripId = "GTFS-rt " + GtfsUtils.getTripId(entity, tripUpdate) + " "; String stopSequence = "stop_sequence " + stopTimeUpdate.getStopSequence(); String stopId = "stop_id " + stopTimeUpdate.getStopId(); String gtfsSummary = " but GTFS stop_sequence " + gtfsStopSequence + " has stop_id " + stop.getId().getId(); RuleUtils.addOccurrence(ValidationRules.E045, tripId + stopSequence + " has " + stopId + gtfsSummary, errors, _log); } }
/** * Checks E040 "stop_time_update doesn't contain stop_id or stop_sequence", and adds any errors to the provided error list. * * @param entity entity that the stopTimeUpdate is from * @param tripUpdate the trip_update for the StopTimeUpdate * @param stopTimeUpdate the stop_time_update to check for E040 * @param errors the list to add the errors to */ private void checkE040(GtfsRealtime.FeedEntity entity, GtfsRealtime.TripUpdate tripUpdate, GtfsRealtime.TripUpdate.StopTimeUpdate stopTimeUpdate, List<OccurrenceModel> errors) { if (!stopTimeUpdate.hasStopSequence() && !stopTimeUpdate.hasStopId()) { RuleUtils.addOccurrence(ValidationRules.E040, GtfsUtils.getTripId(entity, tripUpdate), errors, _log); } }
public Builder mergeFrom(com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate other) { if (other == com.google.transit.realtime.GtfsRealtime.TripUpdate.StopTimeUpdate.getDefaultInstance()) return this; if (other.hasStopSequence()) { setStopSequence(other.getStopSequence()); } if (other.hasStopId()) { bitField0_ |= 0x00000002; stopId_ = other.stopId_; onChanged(); } if (other.hasArrival()) { mergeArrival(other.getArrival()); } if (other.hasDeparture()) { mergeDeparture(other.getDeparture()); } if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship()); } this.mergeExtensionFields(other); this.mergeUnknownFields(other.getUnknownFields()); return this; }