public MinTransitTimeResult getMinTravelTimeToStopsFrom(
CoordinatePoint location, long time,
TransitShedConstraintsBean constraints, int timeSegmentSize)
throws ServiceException {
MinTravelTimeToStopsBean minTravelTimeToStops = _transitDataService.getMinTravelTimeToStopsFrom(
location, time, constraints);
ConstraintsBean c = constraints.getConstraints();
double maxWalkDistance = c.getMaxWalkingDistance();
double walkingVelocity = minTravelTimeToStops.getWalkingVelocity() / 1000;
CoordinateBounds b = SphericalGeometryLibrary.bounds(location, 800);
double latStep = b.getMaxLat() - b.getMinLat();
double lonStep = b.getMaxLon() - b.getMinLon();
GridFactory gridFactory = new GridFactory(latStep, lonStep);
TimedGridFactory timedGridFactory = new TimedGridFactory(latStep / 4,
lonStep / 4, walkingVelocity);
long maxTripLength = c.getMaxTripDuration() * 1000;
for (int i = 0; i < minTravelTimeToStops.getSize(); i++) {
double stopLat = minTravelTimeToStops.getStopLat(i);
double stopLon = minTravelTimeToStops.getStopLon(i);
long duration = minTravelTimeToStops.getTravelTime(i);
double remainingWalkingDistance = (maxTripLength - duration)
* walkingVelocity;
remainingWalkingDistance = Math.min(remainingWalkingDistance,
maxWalkDistance);