Search in sources :

Example 1 with GraphHopperGtfs

use of com.graphhopper.gtfs.GraphHopperGtfs in project graphhopper by graphhopper.

the class ExtendedRouteTypeIT method init.

@BeforeAll
public static void init() {
    GraphHopperConfig ghConfig = new GraphHopperConfig();
    ghConfig.putObject("graph.location", GRAPH_LOC);
    ghConfig.putObject("gtfs.file", "files/another-sample-feed-extended-route-type.zip");
    ghConfig.setProfiles(Arrays.asList(new Profile("foot").setVehicle("foot").setWeighting("fastest"), new Profile("car").setVehicle("car").setWeighting("fastest")));
    Helper.removeDir(new File(GRAPH_LOC));
    graphHopperGtfs = new GraphHopperGtfs(ghConfig);
    graphHopperGtfs.init(ghConfig);
    graphHopperGtfs.importOrLoad();
    ptRouter = new PtRouterImpl.Factory(ghConfig, new TranslationMap().doImport(), graphHopperGtfs.getGraphHopperStorage(), graphHopperGtfs.getLocationIndex(), graphHopperGtfs.getGtfsStorage()).createWithoutRealtimeFeed();
}
Also used : GraphHopperGtfs(com.graphhopper.gtfs.GraphHopperGtfs) TranslationMap(com.graphhopper.util.TranslationMap) File(java.io.File) Profile(com.graphhopper.config.Profile) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with GraphHopperGtfs

use of com.graphhopper.gtfs.GraphHopperGtfs in project graphhopper by graphhopper.

the class RealtimeIT method init.

@BeforeAll
public static void init() {
    GraphHopperConfig ghConfig = new GraphHopperConfig();
    ghConfig.putObject("gtfs.file", "files/sample-feed");
    ghConfig.putObject("graph.location", GRAPH_LOC);
    ghConfig.setProfiles(Arrays.asList(new Profile("foot").setVehicle("foot").setWeighting("fastest"), new Profile("car").setVehicle("car").setWeighting("fastest")));
    Helper.removeDir(new File(GRAPH_LOC));
    graphHopperGtfs = new GraphHopperGtfs(ghConfig);
    graphHopperGtfs.init(ghConfig);
    graphHopperGtfs.importOrLoad();
    graphHopperGtfs.close();
    // Re-load read only
    graphHopperGtfs = new GraphHopperGtfs(ghConfig);
    graphHopperGtfs.init(ghConfig);
    graphHopperGtfs.importOrLoad();
    graphHopperFactory = new PtRouterImpl.Factory(ghConfig, new TranslationMap().doImport(), graphHopperGtfs.getGraphHopperStorage(), graphHopperGtfs.getLocationIndex(), graphHopperGtfs.getGtfsStorage());
}
Also used : GraphHopperGtfs(com.graphhopper.gtfs.GraphHopperGtfs) TranslationMap(com.graphhopper.util.TranslationMap) PtRouterImpl(com.graphhopper.gtfs.PtRouterImpl) File(java.io.File) Profile(com.graphhopper.config.Profile) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

Profile (com.graphhopper.config.Profile)2 GraphHopperGtfs (com.graphhopper.gtfs.GraphHopperGtfs)2 TranslationMap (com.graphhopper.util.TranslationMap)2 File (java.io.File)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 PtRouterImpl (com.graphhopper.gtfs.PtRouterImpl)1