Examples of TripEntry


Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

      for (StopSequence sequence : sequences) {
        maxTripCount.add(sequence.getTripCount(), sequence);

        for (BlockTripEntry blockTrip : sequence.getTrips()) {
          TripEntry trip = blockTrip.getTrip();
          TripNarrative tripNarrative = _narrativeService.getTripForId(trip.getId());
          String headsign = tripNarrative.getTripHeadsign();
          if (headsign != null && headsign.length() > 0)
            names.increment(headsign);
        }
      }
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

    if (_shapePointHelper == null)
      return tripGapDistances;

    for (int index = 0; index < trips.size() - 1; index++) {

      TripEntry tripA = trips.get(index);
      TripEntry tripB = trips.get(index + 1);

      double d = 0;

      ShapePoints shapeFrom = _shapePointHelper.getShapePointsForShapeId(tripA.getShapeId());
      ShapePoints shapeTo = _shapePointHelper.getShapePointsForShapeId(tripB.getShapeId());

      if (shapeFrom != null && shapeTo != null && !shapeFrom.isEmpty()
          && !shapeTo.isEmpty()) {
        int n = shapeFrom.getSize();
        double lat1 = shapeFrom.getLatForIndex(n - 1);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

        continue;

      BlockEntry block = getBlockForMonitoredVehicleJourney(mvj,
          endpointDetails);
      if (block == null) {
        TripEntry trip = getTripForMonitoredVehicleJourney(mvj, endpointDetails);
        if (trip != null)
          block = trip.getBlock();
      }

      if (block == null)
        continue;
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

      return null;

    for (String agencyId : endpointDetails.getDefaultAgencyIds()) {
      AgencyAndId tripId = new AgencyAndId(agencyId,
          fvjRef.getDatedVehicleJourneyRef());
      TripEntry tripEntry = _transitGraphDao.getTripEntryForId(tripId);
      if (tripEntry != null)
        return tripEntry;
    }

    /**
 
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

    if (blockId == null) {
      AgencyAndId tripId = record.getTripId();
      if (tripId == null)
        throw new IllegalArgumentException(
            "at least one of blockId or tripId must be specified for VehicleLocationRecord");
      TripEntry tripEntry = _transitGraphDao.getTripEntryForId(tripId);
      if (tripEntry == null)
        throw new IllegalArgumentException("trip not found with id=" + tripId);
      BlockEntry block = tripEntry.getBlock();
      blockId = block.getId();
    }

    if (record.getServiceDate() == 0)
      throw new IllegalArgumentException("you must specify a serviceDate");
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

      builder.setDistanceAlongBlock(distanceAlongBlock);
      AgencyAndId tripId = record.getTripId();
      if (tripId != null) {
        BlockConfigurationEntry block = blockInstance.getBlock();
        for (BlockTripEntry blockTrip : block.getTrips()) {
          TripEntry trip = blockTrip.getTrip();
          if (trip.getId().equals(tripId)) {
            double distanceAlongTrip = distanceAlongBlock
                - blockTrip.getDistanceAlongBlock();
            builder.setDistanceAlongTrip(distanceAlongTrip);
          }
        }
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

  }

  @Override
  public BlockTripBean getBlockTripAsBean(BlockTripEntry blockTrip) {

    TripEntry trip = blockTrip.getTrip();
    TripBean tripBean = _tripBeanService.getTripForId(trip.getId());
    if (tripBean == null)
      throw new IllegalStateException("unknown trip: " + trip.getId());

    BlockTripBean bean = new BlockTripBean();
    bean.setTrip(tripBean);
    bean.setAccumulatedSlackTime(blockTrip.getAccumulatedSlackTime());
    bean.setDistanceAlongBlock(blockTrip.getDistanceAlongBlock());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

  @Override
  public void reportProblemWithTrip(TripProblemReportBean problem) {

    AgencyAndId tripId = AgencyAndIdLibrary.convertFromString(problem.getTripId());

    TripEntry trip = _graph.getTripEntryForId(tripId);

    if (trip == null)
      return;

    BlockEntry block = trip.getBlock();

    TripProblemReportRecord record = new TripProblemReportRecord();
    record.setCode(problem.getCode());
    record.setServiceDate(problem.getServiceDate());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

    if (tripId != null) {
      bean.setTrip(_tripBeanService.getTripForId(tripId));
    }

    if (tripId != null && stopId != null) {
      TripEntry trip = _graph.getTripEntryForId(tripId);
      StopEntry stop = _graph.getStopEntryForId(stopId);
      if (trip != null && stop != null) {

        AgencyAndId vehicleId = record.getMatchedVehicleId();
        if (vehicleId == null)
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.transit_graph.TripEntry

  public ArrivalAndDepartureInstance getArrivalAndDepartureForStop(
      ArrivalAndDepartureQuery query) {

    StopEntry stop = query.getStop();
    int stopSequence = query.getStopSequence();
    TripEntry trip = query.getTrip();
    long serviceDate = query.getServiceDate();
    AgencyAndId vehicleId = query.getVehicleId();
    long time = query.getTime();

    Map<BlockInstance, List<BlockLocation>> locationsByInstance = _blockStatusService.getBlocks(
        trip.getBlock().getId(), serviceDate, vehicleId, time);

    if (locationsByInstance.isEmpty())
      return null;

    Map.Entry<BlockInstance, List<BlockLocation>> entry = locationsByInstance.entrySet().iterator().next();

    BlockInstance blockInstance = entry.getKey();
    List<BlockLocation> locations = entry.getValue();

    int timeOfServiceDate = (int) ((time - serviceDate) / 1000);

    ArrivalAndDepartureInstance instance = createArrivalAndDeparture(
        blockInstance, trip.getId(), stop.getId(), stopSequence, serviceDate,
        timeOfServiceDate, time);

    if (!locations.isEmpty()) {

      /**
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.