use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class GpxTravelTimeConsistencyTest method beforeClass.
@BeforeAll
public static void beforeClass() {
Helper.removeDir(new File(graphFileFoot));
hopper = new GraphHopper().setOSMFile(osmFile).setProfiles(new Profile("profile").setVehicle("foot").setWeighting("fastest")).setStoreOnFlush(true).setGraphHopperLocation(graphFileFoot).importOrLoad();
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class I18nResourceTest method createConfig.
private static GraphHopperServerConfiguration createConfig() {
GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car").putObject("datareader.file", "../core/files/andorra.osm.pbf").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 NearestResourceTest method createConfig.
private static GraphHopperServerConfiguration createConfig() {
GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car").putObject("datareader.file", "../core/files/andorra.osm.pbf").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 RouteResourceClientHCTest method createConfig.
private static GraphHopperServerConfiguration createConfig() {
GraphHopperServerConfiguration config = new GraphHopperServerTestConfiguration();
config.getGraphHopperConfiguration().putObject("graph.flag_encoders", "car,bike").putObject("prepare.min_network_size", 0).putObject("graph.elevation.provider", "srtm").putObject("graph.elevation.cache_dir", "../core/files/").putObject("datareader.file", "../core/files/andorra.osm.pbf").putObject("graph.encoded_values", "road_class,surface,road_environment,max_speed").putObject("graph.location", DIR).setProfiles(Arrays.asList(new Profile("my_car").setVehicle("car").setWeighting("fastest"), new Profile("my_bike").setVehicle("bike").setWeighting("fastest"))).setCHProfiles(Arrays.asList(new CHProfile("my_car"), new CHProfile("my_bike")));
return config;
}
use of com.graphhopper.config.Profile in project graphhopper by graphhopper.
the class MapMatching2Test method testIssue13.
@Test
public void testIssue13() throws IOException {
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile("../map-matching/files/map-issue13.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-13.gpx"), Gpx.class);
MatchResult mr = mapMatching.match(GpxConversions.getEntries(gpx.trk.get(0)));
// make sure no virtual edges are returned
int edgeCount = hopper.getGraphHopperStorage().getAllEdges().length();
for (EdgeMatch em : mr.getEdgeMatches()) {
assertTrue(em.getEdgeState().getEdge() < edgeCount, "result contains virtual edges:" + em.getEdgeState().toString());
validateEdgeMatch(em);
}
assertEquals(mr.getGpxEntriesLength(), mr.getMatchLength(), 2.5);
assertEquals(28790, mr.getMatchMillis(), 50);
}
Aggregations