}
private ScheduledBlockLocation getScheduledBlockLocationWhenAtStopTime(
BlockStopTimeEntry blockStopTime, BlockStopTimeEntry previousBlockStopTime,
StopTimeEntry stopTime, int scheduleTime, int stopTimeIndex) {
StopEntry stop = stopTime.getStop();
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);
}
result.setClosestStop(blockStopTime);