} else {
toVertex = null;
}
if (opt.startingTransitTripId != null && !opt.arriveBy) {
// Depart on-board mode: set the from vertex to "on-board" state
OnBoardDepartService onBoardDepartService = graph.getService(OnBoardDepartService.class);
if (onBoardDepartService == null)
throw new UnsupportedOperationException("Missing OnBoardDepartService");
fromVertex = onBoardDepartService.setupDepartOnBoard(this);
} else if (!opt.batch || !opt.arriveBy) {
// non-batch mode, or depart-after batch mode: we need a from vertex
fromVertex = graph.streetIndex.getVertexForLocation(opt.from, opt, toVertex);
if (opt.from.hasEdgeId()) {
fromBackEdge = graph.getEdgeById(opt.from.edgeId);