Package com.google.transit.realtime.GtfsRealtimeOneBusAway

Examples of com.google.transit.realtime.GtfsRealtimeOneBusAway.OneBusAwayTripUpdate


  }

  private boolean hasDelayValue(TripUpdate tripUpdate) {

    if (tripUpdate.hasExtension(GtfsRealtimeOneBusAway.obaTripUpdate)) {
      OneBusAwayTripUpdate obaTripUpdate = tripUpdate.getExtension(GtfsRealtimeOneBusAway.obaTripUpdate);
      if (obaTripUpdate.hasDelay()) {
        return true;
      }
    }

    if (tripUpdate.getStopTimeUpdateCount() == 0)
View Full Code Here


      List<TripUpdate> updatesForTrip = tripUpdatesByTripId.get(tripId.getId());
      if (updatesForTrip != null) {
        for (TripUpdate tripUpdate : updatesForTrip) {

          if (tripUpdate.hasExtension(GtfsRealtimeOneBusAway.obaTripUpdate)) {
            OneBusAwayTripUpdate obaTripUpdate = tripUpdate.getExtension(GtfsRealtimeOneBusAway.obaTripUpdate);
            if (obaTripUpdate.hasDelay()) {
              /**
               * TODO: Improved logic around picking the "best" schedule deviation
               */
              int delay = obaTripUpdate.getDelay();
              best.delta = 0;
              best.isInPast = false;
              best.scheduleDeviation = delay;
            }
           
            if (obaTripUpdate.hasTimestamp()) {
              best.timestamp = obaTripUpdate.getTimestamp() * 1000;
            }
          }

          for (StopTimeUpdate stopTimeUpdate : tripUpdate.getStopTimeUpdateList()) {
            BlockStopTimeEntry blockStopTime = getBlockStopTimeForStopTimeUpdate(
View Full Code Here

TOP

Related Classes of com.google.transit.realtime.GtfsRealtimeOneBusAway.OneBusAwayTripUpdate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.