use of org.opentripplanner.routing.RoutingService in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getStoptimesForTrip.
@GET
@Path("/trips/{tripId}/stoptimes")
public List<TripTimeShort> getStoptimesForTrip(@PathParam("tripId") String tripId) {
RoutingService routingService = createRoutingService();
Trip trip = getTrip(routingService, tripId);
TripPattern pattern = getTripPattern(routingService, trip);
// Note, we need the updated timetable not the scheduled one (which contains no real-time updates).
Timetable table = routingService.getTimetableForTripPattern(pattern);
return TripTimeShort.fromTripTimes(table, trip);
}
use of org.opentripplanner.routing.RoutingService in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getPatternsForStop.
@GET
@Path("/stops/{stopId}/patterns")
public List<ApiPatternShort> getPatternsForStop(@PathParam("stopId") String stopId) {
RoutingService routingService = createRoutingService();
Stop stop = getStop(routingService, stopId);
return routingService.getPatternsForStop(stop).stream().map(TripPatternMapper::mapToApiShort).collect(Collectors.toList());
}
Aggregations