Search in sources :

Example 16 with OneRun

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

the class RoutingAlgorithmWithOSMIT method testMonacoMotorcycleCurvature.

@Test
public void testMonacoMotorcycleCurvature() {
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(new OneRun(43.730729, 7.42135, 43.727697, 7.419199, 2703, 119));
    list.add(new OneRun(43.727687, 7.418737, 43.74958, 7.436566, 3749, 170));
    list.add(new OneRun(43.728677, 7.41016, 43.739213, 7.4277, 3175, 169));
    list.add(new OneRun(43.733802, 7.413433, 43.739662, 7.424355, 2423, 141));
    list.add(new OneRun(43.730949, 7.412338, 43.739643, 7.424542, 2253, 120));
    list.add(new OneRun(43.727592, 7.419333, 43.727712, 7.419333, 0, 1));
    runAlgo(testCollector, DIR + "/monaco.osm.gz", "target/monaco-mc-gh", list, "motorcycle", true, "motorcycle", "curvature", true);
    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 17 with OneRun

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

the class RoutingAlgorithmWithOSMIT method testMonacoBike3D_twoSpeedsPerEdge.

@Test
public void testMonacoBike3D_twoSpeedsPerEdge() {
    List<OneRun> list = new ArrayList<OneRun>();
    // 1. alternative: go over steps 'Rampe Major' => 1.7km vs. around 2.7km
    list.add(new OneRun(43.730864, 7.420771, 43.727687, 7.418737, 2710, 118));
    // 2.
    list.add(new OneRun(43.728499, 7.417907, 43.74958, 7.436566, 3777, 194));
    // 3.
    list.add(new OneRun(43.728677, 7.41016, 43.739213, 7.427806, 2776, 167));
    // 4.
    list.add(new OneRun(43.733802, 7.413433, 43.739662, 7.424355, 1544, 84));
    // try reverse direction
    // 1.
    list.add(new OneRun(43.727687, 7.418737, 43.730864, 7.420771, 2599, 115));
    list.add(new OneRun(43.74958, 7.436566, 43.728499, 7.417907, 4199, 165));
    list.add(new OneRun(43.739213, 7.427806, 43.728677, 7.41016, 3261, 177));
    // 4. avoid tunnel(s)!
    list.add(new OneRun(43.739662, 7.424355, 43.733802, 7.413433, 2452, 112));
    runAlgo(testCollector, DIR + "/monaco.osm.gz", "target/monaco-gh", list, "bike2", true, "bike2", "fastest", true);
    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 18 with OneRun

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

the class RoutingAlgorithmWithOSMIT method testMonacoMotorcycle.

@Test
public void testMonacoMotorcycle() {
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(new OneRun(43.730729, 7.42135, 43.727697, 7.419199, 2703, 119));
    list.add(new OneRun(43.727687, 7.418737, 43.74958, 7.436566, 3749, 170));
    list.add(new OneRun(43.728677, 7.41016, 43.739213, 7.4277, 3175, 169));
    list.add(new OneRun(43.733802, 7.413433, 43.739662, 7.424355, 2423, 141));
    list.add(new OneRun(43.730949, 7.412338, 43.739643, 7.424542, 2253, 120));
    list.add(new OneRun(43.727592, 7.419333, 43.727712, 7.419333, 0, 1));
    runAlgo(testCollector, DIR + "/monaco.osm.gz", "target/monaco-mc-gh", list, "motorcycle", true, "motorcycle", "fastest", true);
    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 19 with OneRun

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

the class RoutingAlgorithmWithOSMIT method createMonacoCar.

List<OneRun> createMonacoCar() {
    List<OneRun> list = new ArrayList<OneRun>();
    list.add(new OneRun(43.730729, 7.42135, 43.727697, 7.419199, 2580, 110));
    list.add(new OneRun(43.727687, 7.418737, 43.74958, 7.436566, 3588, 170));
    list.add(new OneRun(43.728677, 7.41016, 43.739213, 7.4277, 2561, 133));
    list.add(new OneRun(43.733802, 7.413433, 43.739662, 7.424355, 2230, 137));
    list.add(new OneRun(43.730949, 7.412338, 43.739643, 7.424542, 2100, 116));
    list.add(new OneRun(43.727592, 7.419333, 43.727712, 7.419333, 0, 1));
    // same special cases where GPS-exact routing could have problems (same edge and neighbor edges)
    list.add(new OneRun(43.727592, 7.419333, 43.727712, 7.41934, 0, 1));
    // on the same edge and very release
    list.add(new OneRun(43.727592, 7.419333, 43.727712, 7.4193, 3, 2));
    // one way stuff
    list.add(new OneRun(43.729445, 7.415063, 43.728856, 7.41472, 103, 4));
    list.add(new OneRun(43.728856, 7.41472, 43.729445, 7.415063, 320, 11));
    return list;
}
Also used : ArrayList(java.util.ArrayList) OneRun(com.graphhopper.routing.util.TestAlgoCollector.OneRun)

Example 20 with OneRun

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

the class RoutingAlgorithmWithOSMIT method testMoscow.

@Test
public void testMoscow() {
    // extracted via ./graphhopper.sh extract "37.582641,55.805261,37.626929,55.824455"
    List<OneRun> list = new ArrayList<OneRun>();
    // choose perpendicular
    // http://localhost:8989/?point=55.818994%2C37.595354&point=55.819175%2C37.596931
    list.add(new OneRun(55.818994, 37.595354, 55.819175, 37.596931, 1052, 14));
    // should choose the closest road not the other one (opposite direction)
    // http://localhost:8989/?point=55.818898%2C37.59661&point=55.819066%2C37.596374
    list.add(new OneRun(55.818898, 37.59661, 55.819066, 37.596374, 24, 2));
    // respect one way!
    // http://localhost:8989/?point=55.819066%2C37.596374&point=55.818898%2C37.59661
    list.add(new OneRun(55.819066, 37.596374, 55.818898, 37.59661, 1114, 23));
    runAlgo(testCollector, DIR + "/moscow.osm.gz", "target/moscow-gh", list, "car", true, "car", "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)

Aggregations

OneRun (com.graphhopper.routing.util.TestAlgoCollector.OneRun)23 ArrayList (java.util.ArrayList)22 Test (org.junit.Test)19 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