Search in sources :

Example 1 with CmdArgs

use of com.graphhopper.util.CmdArgs in project graphhopper by graphhopper.

the class ChangeGraphServletIT method setUp.

@Before
public void setUp() {
    CmdArgs args = new CmdArgs().put(Parameters.CH.PREPARE + "weightings", "no").put("graph.flag_encoders", "car").put("graph.location", DIR).put("datareader.file", "../core/files/andorra.osm.pbf");
    setUpJetty(args);
}
Also used : CmdArgs(com.graphhopper.util.CmdArgs) Before(org.junit.Before)

Example 2 with CmdArgs

use of com.graphhopper.util.CmdArgs in project graphhopper by graphhopper.

the class GraphHopperServletIT method setUp.

@Before
public void setUp() {
    CmdArgs args = new CmdArgs().put("config", "../config-example.properties").put("datareader.file", "../core/files/andorra.osm.pbf").put("graph.location", DIR);
    setUpJetty(args);
}
Also used : CmdArgs(com.graphhopper.util.CmdArgs) Before(org.junit.Before)

Example 3 with CmdArgs

use of com.graphhopper.util.CmdArgs in project graphhopper by graphhopper.

the class NearestServletIT method setUp.

@Before
public void setUp() {
    CmdArgs args = new CmdArgs().put("config", "../config-example.properties").put("datareader.file", "../core/files/andorra.osm.pbf").put("graph.location", dir);
    setUpJetty(args);
}
Also used : CmdArgs(com.graphhopper.util.CmdArgs) Before(org.junit.Before)

Example 4 with CmdArgs

use of com.graphhopper.util.CmdArgs in project graphhopper by graphhopper.

the class Import method main.

public static void main(String[] strs) throws Exception {
    CmdArgs args = CmdArgs.read(strs);
    GraphHopper hopper = new GraphHopperOSM().init(args);
    hopper.importOrLoad();
    hopper.close();
}
Also used : CmdArgs(com.graphhopper.util.CmdArgs) GraphHopperOSM(com.graphhopper.reader.osm.GraphHopperOSM) GraphHopper(com.graphhopper.GraphHopper)

Example 5 with CmdArgs

use of com.graphhopper.util.CmdArgs in project graphhopper by graphhopper.

the class GraphHopperOSMTest method testLoadOSMNoCH.

@Test
public void testLoadOSMNoCH() {
    GraphHopper gh = new GraphHopperOSM().setStoreOnFlush(true).setCHEnabled(false).setEncodingManager(new EncodingManager("car")).setGraphHopperLocation(ghLoc).setDataReaderFile(testOsm);
    gh.importOrLoad();
    assertFalse(gh.getAlgorithmFactory(new HintsMap("fastest")) instanceof PrepareContractionHierarchies);
    GHResponse rsp = gh.route(new GHRequest(51.2492152, 9.4317166, 51.2, 9.4));
    assertFalse(rsp.hasErrors());
    assertEquals(3, rsp.getBest().getPoints().getSize());
    gh.close();
    gh = new GraphHopperOSM().setStoreOnFlush(true).setCHEnabled(false).setEncodingManager(new EncodingManager("car"));
    assertTrue(gh.load(ghLoc));
    rsp = gh.route(new GHRequest(51.2492152, 9.4317166, 51.2, 9.4));
    assertFalse(rsp.hasErrors());
    assertEquals(3, rsp.getBest().getPoints().getSize());
    gh.close();
    gh = new GraphHopperOSM().setGraphHopperLocation(ghLoc).setDataReaderFile(testOsm).init(new CmdArgs().put("graph.flag_encoders", "car").put(Parameters.CH.PREPARE + "weightings", "no"));
    assertFalse(gh.getAlgorithmFactory(new HintsMap("fastest")) instanceof PrepareContractionHierarchies);
    gh.close();
}
Also used : CmdArgs(com.graphhopper.util.CmdArgs) PrepareContractionHierarchies(com.graphhopper.routing.ch.PrepareContractionHierarchies) GHRequest(com.graphhopper.GHRequest) GraphHopper(com.graphhopper.GraphHopper) GHResponse(com.graphhopper.GHResponse) Test(org.junit.Test)

Aggregations

CmdArgs (com.graphhopper.util.CmdArgs)10 Before (org.junit.Before)5 Test (org.junit.Test)4 GHRequest (com.graphhopper.GHRequest)3 GraphHopper (com.graphhopper.GraphHopper)3 GHResponse (com.graphhopper.GHResponse)2 PathWrapper (com.graphhopper.PathWrapper)1 GraphHopperOSM (com.graphhopper.reader.osm.GraphHopperOSM)1 PrepareContractionHierarchies (com.graphhopper.routing.ch.PrepareContractionHierarchies)1 GHPoint (com.graphhopper.util.shapes.GHPoint)1 IOException (java.io.IOException)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1