Search in sources :

Example 11 with GraphHopperServerConfiguration

use of com.graphhopper.application.GraphHopperServerConfiguration in project graphhopper by graphhopper.

the class PtIsochroneTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "foot").putObject("graph.location", GRAPH_LOC).putObject("gtfs.file", "../reader-gtfs/files/sample-feed").setProfiles(Collections.singletonList(new Profile("foot").setVehicle("foot").setWeighting("fastest")));
    Helper.removeDir(new File(GRAPH_LOC));
    return config;
}
Also used : GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) File(java.io.File) Profile(com.graphhopper.config.Profile)

Example 12 with GraphHopperServerConfiguration

use of com.graphhopper.application.GraphHopperServerConfiguration in project graphhopper by graphhopper.

the class RouteResourceCustomModelTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "bike,car,foot,wheelchair,roads").putObject("prepare.min_network_size", 200).putObject("datareader.file", "../core/files/north-bayreuth.osm.gz").putObject("graph.location", DIR).putObject("graph.encoded_values", "max_height,max_weight,max_width,hazmat,toll,surface,track_type").putObject("custom_model_folder", "./src/test/resources/com/graphhopper/application/resources").setProfiles(Arrays.asList(new Profile("wheelchair"), new CustomProfile("roads").setCustomModel(new CustomModel()).setVehicle("roads"), new CustomProfile("car").setCustomModel(new CustomModel()).setVehicle("car"), new CustomProfile("bike").setCustomModel(new CustomModel().setDistanceInfluence(0)).setVehicle("bike"), new Profile("bike_fastest").setWeighting("fastest").setVehicle("bike"), new CustomProfile("truck").setVehicle("car").putHint("custom_model_file", "truck.yml"), new CustomProfile("cargo_bike").setVehicle("bike").putHint("custom_model_file", "cargo_bike.yml"), new CustomProfile("json_bike").setVehicle("bike").putHint("custom_model_file", "json_bike.json"), new Profile("foot_profile").setVehicle("foot").setWeighting("fastest"), new CustomProfile("car_no_unclassified").setCustomModel(new CustomModel(new CustomModel().addToPriority(If("road_class == UNCLASSIFIED", LIMIT, 0)))).setVehicle("car"), new CustomProfile("custom_bike").setCustomModel(new CustomModel().addToSpeed(If("road_class == PRIMARY", LIMIT, 28)).addToPriority(If("max_width < 1.2", MULTIPLY, 0))).setVehicle("bike"), new CustomProfile("custom_bike2").setCustomModel(new CustomModel(new CustomModel().addToPriority(If("road_class == TERTIARY || road_class == TRACK", MULTIPLY, 0)))).setVehicle("bike"), new CustomProfile("custom_bike3").setCustomModel(new CustomModel(new CustomModel().addToSpeed(If("road_class == TERTIARY || road_class == TRACK", MULTIPLY, 10)).addToSpeed(If("true", LIMIT, 40)))).setVehicle("bike"))).setCHProfiles(Arrays.asList(new CHProfile("truck"), new CHProfile("car_no_unclassified")));
    return config;
}
Also used : CHProfile(com.graphhopper.config.CHProfile) GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) CustomProfile(com.graphhopper.routing.weighting.custom.CustomProfile) CustomProfile(com.graphhopper.routing.weighting.custom.CustomProfile) Profile(com.graphhopper.config.Profile) CHProfile(com.graphhopper.config.CHProfile) CustomModel(com.graphhopper.util.CustomModel)

Example 13 with GraphHopperServerConfiguration

use of com.graphhopper.application.GraphHopperServerConfiguration in project graphhopper by graphhopper.

the class RouteResourceWithEleTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.elevation.provider", "srtm").putObject("graph.elevation.cache_dir", "../core/files/").putObject("prepare.min_network_size", 0).putObject("graph.flag_encoders", "car").putObject("datareader.file", "../core/files/monaco.osm.gz").putObject("graph.location", dir).setProfiles(Collections.singletonList(new Profile("profile").setVehicle("car").setWeighting("fastest")));
    return config;
}
Also used : GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) Profile(com.graphhopper.config.Profile)

Example 14 with GraphHopperServerConfiguration

use of com.graphhopper.application.GraphHopperServerConfiguration in project graphhopper by graphhopper.

the class IsochroneResourceTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car|turn_costs=true").putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.location", DIR).setProfiles(Arrays.asList(new Profile("fast_car").setVehicle("car").setWeighting("fastest").setTurnCosts(true), new Profile("short_car").setVehicle("car").setWeighting("shortest").setTurnCosts(true), new Profile("fast_car_no_turn_restrictions").setVehicle("car").setWeighting("fastest").setTurnCosts(false)));
    return config;
}
Also used : GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) Profile(com.graphhopper.config.Profile)

Example 15 with GraphHopperServerConfiguration

use of com.graphhopper.application.GraphHopperServerConfiguration in project graphhopper by graphhopper.

the class PtRouteResourceTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("datareader.file", "../reader-gtfs/files/beatty.osm").putObject("gtfs.file", "../reader-gtfs/files/sample-feed").putObject("graph.location", DIR).setProfiles(Collections.singletonList(new Profile("foot").setVehicle("foot").setWeighting("fastest")));
    return config;
}
Also used : GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) Profile(com.graphhopper.config.Profile)

Aggregations

GraphHopperServerConfiguration (com.graphhopper.application.GraphHopperServerConfiguration)19 Profile (com.graphhopper.config.Profile)19 GraphHopperServerTestConfiguration (com.graphhopper.application.util.GraphHopperServerTestConfiguration)17 CHProfile (com.graphhopper.config.CHProfile)8 LMProfile (com.graphhopper.config.LMProfile)6 CustomProfile (com.graphhopper.routing.weighting.custom.CustomProfile)2 CustomModel (com.graphhopper.util.CustomModel)2 File (java.io.File)1