Search in sources :

Example 1 with OneRun

use of com.graphhopper.routing.util.TestAlgoCollector.OneRun in project graphhopper by graphhopper.

the class RoutingAlgorithmWithOSMIT method testSidewalkNo.

@Test
public void testSidewalkNo() {
    List<OneRun> list = new ArrayList<OneRun>();
    // roundabout contains sidewalk=no which should be avoided
    list.add(new OneRun(57.154888, -2.101822, 57.153445, -2.099869, 329, 31));
    // longer path should go through tertiary, see discussion in #476
    list.add(new OneRun(57.154888, -2.101822, 57.147299, -2.096286, 1118, 68));
    boolean testAlsoCH = false, is3D = false;
    runAlgo(testCollector, DIR + "/map-sidewalk-no.osm.gz", "target/graph-sidewalkno", list, "hike", testAlsoCH, "hike", "fastest", is3D);
    assertEquals(testCollector.toString(), 0, testCollector.errors.size());
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun) Test(org.junit.Test)

Example 2 with OneRun

use of com.graphhopper.routing.util.TestAlgoCollector.OneRun in project graphhopper by graphhopper.

the class RoutingAlgorithmWithOSMIT method testMoscowTurnCosts.

@Test
public void testMoscowTurnCosts() {
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(new OneRun(55.813357, 37.5958585, 55.811042, 37.594689, 1043.99, 12));
    list.add(new OneRun(55.813159, 37.593884, 55.811278, 37.594217, 1048, 13));
    // TODO include CH
    boolean testAlsoCH = false, is3D = false;
    runAlgo(testCollector, DIR + "/moscow.osm.gz", "target/graph-moscow", list, "car|turn_costs=true", testAlsoCH, "car", "fastest", is3D);
    assertEquals(testCollector.toString(), 0, testCollector.errors.size());
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun) Test(org.junit.Test)

Example 3 with OneRun

use of com.graphhopper.routing.util.TestAlgoCollector.OneRun in project graphhopper by graphhopper.

the class RoutingAlgorithmWithOSMIT method testHarsdorf.

@Test
public void testHarsdorf() {
    List<OneRun> list = new ArrayList<OneRun>();
    // TODO somehow the bigger road is take even if we make it less preferred (e.g. introduce AVOID AT ALL costs for lanes=2&&maxspeed>50)
    list.add(new OneRun(50.004333, 11.600254, 50.044449, 11.543434, 6952, 190));
    // choose Unterloher Weg and the following residential + cycleway
    // list.add(new OneRun(50.004333, 11.600254, 50.044449, 11.543434, 6931, 184));
    runAlgo(testCollector, DIR + "/north-bayreuth.osm.gz", "target/north-bayreuth-gh", list, "bike", true, "bike", "fastest", false);
    assertEquals(testCollector.toString(), 0, testCollector.errors.size());
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun) Test(org.junit.Test)

Example 4 with OneRun

use of com.graphhopper.routing.util.TestAlgoCollector.OneRun in project graphhopper by graphhopper.

the class RoutingAlgorithmWithOSMIT method testMonacoVia.

@Test
public void testMonacoVia() {
    OneRun oneRun = new OneRun();
    oneRun.add(43.730729, 7.42135, 0, 0);
    oneRun.add(43.727697, 7.419199, 2581, 110);
    oneRun.add(43.726387, 7.4, 3001, 90);
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(oneRun);
    runAlgo(testCollector, DIR + "/monaco.osm.gz", "target/monaco-gh", list, "car", true, "car", "shortest", false);
    assertEquals(testCollector.toString(), 0, testCollector.errors.size());
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun) Test(org.junit.Test)

Example 5 with OneRun

use of com.graphhopper.routing.util.TestAlgoCollector.OneRun in project graphhopper by graphhopper.

the class RoutingAlgorithmWithOSMIT method testMonacoBike.

@Test
public void testMonacoBike() {
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(new OneRun(43.730864, 7.420771, 43.727687, 7.418737, 1642, 87));
    list.add(new OneRun(43.727687, 7.418737, 43.74958, 7.436566, 3580, 168));
    list.add(new OneRun(43.728677, 7.41016, 43.739213, 7.427806, 2323, 121));
    list.add(new OneRun(43.733802, 7.413433, 43.739662, 7.424355, 1434, 89));
    runAlgo(testCollector, DIR + "/monaco.osm.gz", "target/monaco-gh", list, "bike", true, "bike", "shortest", false);
    assertEquals(testCollector.toString(), 0, testCollector.errors.size());
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun) Test(org.junit.Test)

Aggregations

OneRun (com.graphhopper.routing.util.TestAlgoCollector.OneRun)25 ArrayList (java.util.ArrayList)24 Test (org.junit.Test)21 GraphHopper (com.graphhopper.GraphHopper)2 GraphHopperOSM (com.graphhopper.reader.osm.GraphHopperOSM)2 AlgoHelperEntry (com.graphhopper.routing.util.TestAlgoCollector.AlgoHelperEntry)2 LocationIndex (com.graphhopper.storage.index.LocationIndex)2 File (java.io.File)2 SRTMProvider (com.graphhopper.reader.dem.SRTMProvider)1 ShortestWeighting (com.graphhopper.routing.weighting.ShortestWeighting)1 Weighting (com.graphhopper.routing.weighting.Weighting)1 Graph (com.graphhopper.storage.Graph)1 QueryResult (com.graphhopper.storage.index.QueryResult)1 IOException (java.io.IOException)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1