Search in sources :

Example 16 with GraphHopperServerConfiguration

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

the class RouteResourceCustomModelLMTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car,foot").putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.location", DIR).putObject("graph.encoded_values", "surface").setProfiles(Arrays.asList(// give strange profile names to ensure that we do not mix vehicle and profile:
    new CustomProfile("car_custom").setCustomModel(new CustomModel()).setVehicle("car"), new Profile("foot_profile").setVehicle("foot").setWeighting("fastest"), new CustomProfile("foot_custom").setCustomModel(new CustomModel()).setVehicle("foot"))).setLMProfiles(Arrays.asList(new LMProfile("car_custom"), new LMProfile("foot_custom")));
    return config;
}
Also used : GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) CustomProfile(com.graphhopper.routing.weighting.custom.CustomProfile) LMProfile(com.graphhopper.config.LMProfile) CustomModel(com.graphhopper.util.CustomModel) CustomProfile(com.graphhopper.routing.weighting.custom.CustomProfile) Profile(com.graphhopper.config.Profile) LMProfile(com.graphhopper.config.LMProfile)

Example 17 with GraphHopperServerConfiguration

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

the class RouteResourceIssue1574Test method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    // this is the reason we put this test into an extra file: we can only reproduce the bug of issue 1574 by increasing the one-way-network size
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car").putObject("prepare.min_network_size", 0).putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.location", DIR).setProfiles(Collections.singletonList(new Profile("car_profile").setVehicle("car").setWeighting("fastest"))).setCHProfiles(Collections.singletonList(new CHProfile("car_profile")));
    return config;
}
Also used : CHProfile(com.graphhopper.config.CHProfile) GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) CHProfile(com.graphhopper.config.CHProfile) Profile(com.graphhopper.config.Profile)

Example 18 with GraphHopperServerConfiguration

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

the class RouteResourceTurnCostsLegacyTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car|turn_costs=true").putObject("prepare.min_network_size", 0).putObject("datareader.file", "../core/files/moscow.osm.gz").putObject("graph.encoded_values", "road_class,surface,road_environment,max_speed").putObject("graph.location", DIR).setProfiles(Arrays.asList(new Profile("my_car_turn_costs").setVehicle("car").setWeighting("fastest").setTurnCosts(true), new Profile("my_car_no_turn_costs").setVehicle("car").setWeighting("fastest").setTurnCosts(false))).setCHProfiles(Arrays.asList(new CHProfile("my_car_turn_costs"), new CHProfile("my_car_no_turn_costs"))).setLMProfiles(Arrays.asList(new LMProfile("my_car_no_turn_costs"), // no need for a second LM preparation: we can just cross query here
    new LMProfile("my_car_turn_costs").setPreparationProfile("my_car_no_turn_costs")));
    return config;
}
Also used : CHProfile(com.graphhopper.config.CHProfile) GraphHopperServerConfiguration(com.graphhopper.application.GraphHopperServerConfiguration) GraphHopperServerTestConfiguration(com.graphhopper.application.util.GraphHopperServerTestConfiguration) LMProfile(com.graphhopper.config.LMProfile) CHProfile(com.graphhopper.config.CHProfile) Profile(com.graphhopper.config.Profile) LMProfile(com.graphhopper.config.LMProfile)

Example 19 with GraphHopperServerConfiguration

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

the class MvtResourceTest method createConfig.

private static GraphHopperServerConfiguration createConfig() {
    GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
    config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car").putObject("graph.encoded_values", "road_class,road_environment,max_speed,surface").putObject("prepare.min_network_size", 0).putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.location", DIR).setProfiles(Collections.singletonList(new Profile("car").setVehicle("car").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