Search in sources :

Example 1 with TransferGraphLinker

use of org.opentripplanner.routing.edgetype.factory.TransferGraphLinker in project OpenTripPlanner by opentripplanner.

the class ConstantsForTests method setupPortland.

private void setupPortland() {
    try {
        portlandContext = GtfsLibrary.readGtfs(new File(ConstantsForTests.PORTLAND_GTFS));
        portlandGraph = new Graph();
        GTFSPatternHopFactory factory = new GTFSPatternHopFactory(portlandContext);
        factory.run(portlandGraph);
        TransferGraphLinker linker = new TransferGraphLinker(portlandGraph);
        linker.run();
        // TODO: eliminate GTFSContext
        // this is now making a duplicate calendarservicedata but it's oh so practical
        portlandGraph.putService(CalendarServiceData.class, GtfsLibrary.createCalendarServiceData(portlandContext.getDao()));
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
    StreetLinkerModule ttsnm = new StreetLinkerModule();
    ttsnm.buildGraph(portlandGraph, new HashMap<Class<?>, Object>());
}
Also used : Graph(org.opentripplanner.routing.graph.Graph) TransferGraphLinker(org.opentripplanner.routing.edgetype.factory.TransferGraphLinker) GTFSPatternHopFactory(org.opentripplanner.routing.edgetype.factory.GTFSPatternHopFactory) File(java.io.File) StreetLinkerModule(org.opentripplanner.graph_builder.module.StreetLinkerModule) IOException(java.io.IOException)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 StreetLinkerModule (org.opentripplanner.graph_builder.module.StreetLinkerModule)1 GTFSPatternHopFactory (org.opentripplanner.routing.edgetype.factory.GTFSPatternHopFactory)1 TransferGraphLinker (org.opentripplanner.routing.edgetype.factory.TransferGraphLinker)1 Graph (org.opentripplanner.routing.graph.Graph)1