use of org.opentripplanner.routing.vertextype.TransitStopDepart in project OpenTripPlanner by opentripplanner.
the class TimetableSnapshotTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
context = GtfsLibrary.readGtfs(new File(ConstantsForTests.FAKE_GTFS));
graph = new Graph();
GTFSPatternHopFactory factory = new GTFSPatternHopFactory(context);
factory.run(graph);
graph.putService(CalendarServiceData.class, GtfsLibrary.createCalendarServiceData(context.getDao()));
patternIndex = new HashMap<AgencyAndId, TripPattern>();
for (TransitStopDepart tsd : Iterables.filter(graph.getVertices(), TransitStopDepart.class)) {
for (TransitBoardAlight tba : Iterables.filter(tsd.getOutgoing(), TransitBoardAlight.class)) {
if (!tba.boarding)
continue;
TripPattern pattern = tba.getPattern();
for (Trip trip : pattern.getTrips()) {
patternIndex.put(trip.getId(), pattern);
}
}
}
}
Aggregations