use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class MapMatching2Test method testIssue70.
@Test
public void testIssue70() throws IOException {
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile("../map-matching/files/issue-70.osm.gz");
hopper.setGraphHopperLocation(GH_LOCATION);
hopper.setProfiles(new Profile("my_profile").setVehicle("car").setWeighting("fastest"));
hopper.getLMPreparationHandler().setLMProfiles(new LMProfile("my_profile"));
hopper.importOrLoad();
MapMatching mapMatching = new MapMatching(hopper, new PMap().putObject("profile", "my_profile"));
Gpx gpx = xmlMapper.readValue(getClass().getResourceAsStream("/issue-70.gpx"), Gpx.class);
MatchResult mr = mapMatching.match(GpxConversions.getEntries(gpx.trk.get(0)));
assertEquals(Arrays.asList("Милана Видака", "Бранка Радичевића", "Здравка Челара"), fetchStreets(mr.getEdgeMatches()));
for (EdgeMatch edgeMatch : mr.getEdgeMatches()) {
validateEdgeMatch(edgeMatch);
}
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class RoutingAdditivityTest method setup.
@BeforeAll
public static void setup() {
Helper.removeDir(new File(GH_LOCATION));
graphHopper = new GraphHopper();
graphHopper.setOSMFile("../map-matching/files/leipzig_germany.osm.pbf");
graphHopper.setGraphHopperLocation(GH_LOCATION);
graphHopper.setProfiles(new Profile("my_profile").setVehicle("car").setWeighting("fastest"));
graphHopper.getLMPreparationHandler().setLMProfiles(new LMProfile("my_profile"));
graphHopper.importOrLoad();
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class MapMatchingResourceTest method createConfig.
private static GraphHopperServerConfiguration createConfig() {
GraphHopperServerConfiguration config = new GraphHopperServerConfiguration();
config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car,bike").putObject("datareader.file", "../map-matching/files/leipzig_germany.osm.pbf").putObject("graph.location", DIR).setProfiles(Arrays.asList(new Profile("fast_car").setVehicle("car").setWeighting("fastest"), new Profile("fast_bike").setVehicle("bike").setWeighting("fastest")));
return config;
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class NearestResourceWithEleTest 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("car").setVehicle("car").setWeighting("fastest")));
return config;
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class RouteResourceTest method createConfig.
private static GraphHopperServerConfiguration createConfig() {
GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
config.getGraphHopperConfiguration().putObject("profiles_mapbox", mapboxResolver).putObject("graph.flag_encoders", "car").putObject("prepare.min_network_size", 0).putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.encoded_values", "road_class,surface,road_environment,max_speed").putObject("graph.location", DIR).putObject(MAX_NON_CH_POINT_DISTANCE, 10e6).setProfiles(Collections.singletonList(new Profile("my_car").setVehicle("car").setWeighting("fastest"))).setCHProfiles(Collections.singletonList(new CHProfile("my_car")));
return config;
}
Aggregations