Package org.onebusaway.transit_data_federation.services.transit_graph

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


    List<BlockStopTimeEntry> stopTimes = blockConfig.getStopTimes();
    return stopTime.getBlockSequence() + 1 < stopTimes.size();
  }
 
  public static boolean hasNextStopTime(StopTimeInstance instance) {
    BlockStopTimeEntry stopTime = instance.getStopTime();
    BlockTripEntry trip = stopTime.getTrip();
    BlockConfigurationEntry blockConfig = trip.getBlockConfiguration();
    List<BlockStopTimeEntry> stopTimes = blockConfig.getStopTimes();
    return stopTime.getBlockSequence() + 1 < stopTimes.size();
  }
View Full Code Here


  private double getTransitLegBuilderAsDistance(TransitLegBuilder builder) {

    BlockTripInstance blockTripInstanceFrom = builder.getBlockTripInstanceFrom();
    BlockTripEntry trip = blockTripInstanceFrom.getBlockTrip();

    BlockStopTimeEntry fromStop = null;
    BlockStopTimeEntry toStop = null;

    if (builder.getFromStop() != null)
      fromStop = builder.getFromStop().getBlockStopTime();

    if (builder.getToStop() != null)
      toStop = builder.getToStop().getBlockStopTime();

    if (fromStop == null && toStop == null)
      return trip.getTrip().getTotalTripDistance();

    if (fromStop == null && toStop != null)
      return toStop.getDistanceAlongBlock() - trip.getDistanceAlongBlock();

    if (fromStop != null && toStop == null)
      return trip.getDistanceAlongBlock()
          + trip.getTrip().getTotalTripDistance()
          - fromStop.getDistanceAlongBlock();

    return toStop.getDistanceAlongBlock() - fromStop.getDistanceAlongBlock();
  }
View Full Code Here

    if (shapeId == null)
      return null;

    ShapePoints shapePoints = _shapePointService.getShapePointsForShapeId(shapeId);

    BlockStopTimeEntry fromStop = null;
    BlockStopTimeEntry toStop = null;

    if (builder.getFromStop() != null)
      fromStop = builder.getFromStop().getBlockStopTime();

    if (builder.getToStop() != null)
      toStop = builder.getToStop().getBlockStopTime();

    CoordinatePoint nextPoint = null;

    BlockTripEntry nextBlockTrip = builder.getNextTrip();
    if (nextBlockTrip != null) {
      TripEntry nextTrip = nextBlockTrip.getTrip();
      AgencyAndId nextShapeId = nextTrip.getShapeId();
      if (nextShapeId != null) {
        ShapePoints nextShapePoints = _shapePointService.getShapePointsForShapeId(nextShapeId);
        nextPoint = nextShapePoints.getPointForIndex(0);
      }
    }

    if (fromStop == null && toStop == null) {
      return ShapeSupport.getFullPath(shapePoints, nextPoint);
    }

    if (fromStop == null && toStop != null) {
      return ShapeSupport.getPartialPathToStop(shapePoints,
          toStop.getStopTime());
    }

    if (fromStop != null && toStop == null) {
      return ShapeSupport.getPartialPathFromStop(shapePoints,
          fromStop.getStopTime(), nextPoint);
    }

    return ShapeSupport.getPartialPathBetweenStops(shapePoints,
        fromStop.getStopTime(), toStop.getStopTime());
  }
View Full Code Here

    ArrivalAndDepartureInstance fromStopTimeInstance = builder.getFromStop();

    if (fromStopTimeInstance == null)
      return;

    BlockStopTimeEntry bstFrom = fromStopTimeInstance.getBlockStopTime();

    StopTimeEntry fromStopTime = bstFrom.getStopTime();
    StopTimeNarrative stopTimeNarrative = _narrativeService.getStopTimeForEntry(fromStopTime);
    transitLeg.setRouteShortName(stopTimeNarrative.getRouteShortName());
    transitLeg.setTripHeadsign(stopTimeNarrative.getStopHeadsign());

    StopEntry fromStop = fromStopTimeInstance.getStop();
View Full Code Here

    StopEntry toStop = toStopTimeInstance.getStop();
    StopBean toStopBean = _stopBeanService.getStopForId(toStop.getId());
    transitLeg.setToStop(toStopBean);

    BlockStopTimeEntry blockStopTime = toStopTimeInstance.getBlockStopTime();
    StopTimeEntry stopTime = blockStopTime.getStopTime();
    transitLeg.setToStopSequence(stopTime.getSequence());

    leg.setTo(toStop.getStopLocation());

    BlockLocation blockLocation = toStopTimeInstance.getBlockLocation();
View Full Code Here

  public ServiceInterval getServiceInterval() {
    return _serviceInterval;
  }

  public StopEntry getStop() {
    BlockStopTimeEntry blockStopTime = getStopTimeForIndex(0);
    return blockStopTime.getStopTime().getStop();
  }
View Full Code Here

    List<BlockTripEntry> trips = blockIndex.getTrips();

    for (BlockTripEntry trip : trips) {

      BlockStopTimeEntry blockStopTime = trip.getStopTimes().get(blockSequence);
      StopTimeEntry stopTime = blockStopTime.getStopTime();

      serviceInterval = ServiceInterval.extend(serviceInterval,
          stopTime.getArrivalTime(), stopTime.getDepartureTime());
    }
View Full Code Here

    StopEntry stop = _instance.getStop();

    /**
     * We can stay on the bus if applicable
     */
    BlockStopTimeEntry bst = _instance.getBlockStopTime();
    if (bst.getBlockSequence() > 0) {
      edges.add(new BlockDwellEdge(_context, _instance));
    }

    /**
     * We can get off the bus
View Full Code Here

      return _blockConfigs.size();
    }

    @Override
    public BlockTripEntry get(int index) {
      BlockStopTimeEntry stopTime = getStopTimeForIndex(index);
      return stopTime.getTrip();
    }
View Full Code Here

      BlockConfigurationEntry blockConfig = blockInstance.getBlock();
      List<BlockStopTimeEntry> stopTimes = blockConfig.getStopTimes();
      int maxBlockSequence = Math.min(obaState.getMaxBlockSequence(),
          stopTimes.size());

      BlockStopTimeEntry blockStopTime = instance.getBlockStopTime();
      int sequence = blockStopTime.getBlockSequence();
      StopTimeEntry origStopTime = blockStopTime.getStopTime();

      double minTime = Double.POSITIVE_INFINITY;

      while (sequence < maxBlockSequence) {

        blockStopTime = stopTimes.get(sequence);
        StopTimeEntry stopTime = blockStopTime.getStopTime();
        StopEntry stop = stopTime.getStop();

        double d = SphericalGeometryLibrary.distance(stop.getStopLat(),
            stop.getStopLon(), target.getY(), target.getX());
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry

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.