Package org.onebusaway.transit_data_federation.impl.shapes

Examples of org.onebusaway.transit_data_federation.impl.shapes.PointAndOrientation


    ScheduledBlockLocation result = new ScheduledBlockLocation();

    int shapePointIndex = stopTime.getShapePointIndex();

    PointAndOrientation po = getLocationAlongShape(blockStopTime.getTrip(),
        blockStopTime.getDistanceAlongBlock(), shapePointIndex,
        shapePointIndex + 1);
    if (po != null) {
      result.setLocation(po.getPoint());
      result.setOrientation(po.getOrientation());
    } else {
      CoordinatePoint location = new CoordinatePoint(stop.getStopLat(),
          stop.getStopLon());
      result.setLocation(location);
      result.setOrientation(0);
View Full Code Here


      shapePointIndexTo = nextShapePointIndex(after);
    }

    BlockTripEntry activeTrip = result.getActiveTrip();

    PointAndOrientation po = getLocationAlongShape(activeTrip,
        distanceAlongBlock, shapePointIndexFrom, shapePointIndexTo);

    if (po != null) {
      result.setLocation(po.getPoint());
      result.setOrientation(po.getOrientation());
      return result;
    }

    StopEntry beforeStop = before.getStop();
    StopEntry afterStop = after.getStop();
View Full Code Here

        inService = true;
      else
        distanceAlongBlock = 0.0;
    }

    PointAndOrientation po = null;

    if (!Double.isNaN(distanceAlongBlock))
      po = getLocationAlongShape(blockStopTime.getTrip(), distanceAlongBlock,
          0, nextShapePointIndex(stopTime));

    ScheduledBlockLocation result = new ScheduledBlockLocation();

    if (po != null) {
      result.setLocation(po.getPoint());
      result.setOrientation(po.getOrientation());
    }

    result.setClosestStop(blockStopTime);
    result.setClosestStopTimeOffset(stopTime.getArrivalTime() - scheduleTime);
    result.setPreviousStop(null);
View Full Code Here

    /**
     * In this case, distance along block and distance along trip are the same
     * because we are still in the first trip of the block
     */

    PointAndOrientation po = getLocationAlongShape(activeTrip,
        distanceAlongBlock, shapePointIndexFrom, shapePointIndexTo);

    if (po != null) {
      location.setLocation(po.getPoint());
      location.setOrientation(po.getOrientation());
    }

    return location;
  }
View Full Code Here

          continue;

        ShapeIdAndDistance key = new ShapeIdAndDistance(shapeId,
            stopTime.getShapeDistTraveled());

        PointAndOrientation orientation = orientationsByKey.get(key);

        if (orientation == null) {

          int indexFrom = Math.max(0, shapePointIndex - 5);
          int indexTo = Math.min(shapePoints.getSize(), shapePointIndex + 5);
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.impl.shapes.PointAndOrientation

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.