use of org.opentripplanner.analyst.request.IsoChroneRequest in project OpenTripPlanner by opentripplanner.
the class LIsochrone method computeIsochrone.
/**
* Generic method to compute isochrones. Parse the request, call the adequate builder, and
* return a list of generic isochrone data.
*
* @return
* @throws Exception
*/
public List<IsochroneData> computeIsochrone() throws Exception {
if (debug == null)
debug = false;
if (precisionMeters < 10)
throw new IllegalArgumentException("Too small precisionMeters: " + precisionMeters);
if (offRoadDistanceMeters < 10)
throw new IllegalArgumentException("Too small offRoadDistanceMeters: " + offRoadDistanceMeters);
IsoChroneRequest isoChroneRequest = new IsoChroneRequest(cutoffSecList);
isoChroneRequest.includeDebugGeometry = debug;
isoChroneRequest.precisionMeters = precisionMeters;
isoChroneRequest.offRoadDistanceMeters = offRoadDistanceMeters;
if (coordinateOrigin != null)
isoChroneRequest.coordinateOrigin = new GenericLocation(null, coordinateOrigin).getCoordinate();
RoutingRequest sptRequest = buildRequest();
if (maxTimeSec != null) {
isoChroneRequest.maxTimeSec = maxTimeSec;
} else {
isoChroneRequest.maxTimeSec = isoChroneRequest.maxCutoffSec;
}
Router router = otpServer.getRouter(routerId);
return router.isoChroneSPTRenderer.getIsochrones(isoChroneRequest, sptRequest);
}
Aggregations