GraphHopper.com | Forum | GitHub | Maps | Blog

No route with very simple routing


#1

Hi everyone, i made a really simple graph with JOSM and exported the osm file.

As you can see is a highway with 3 nodes so, easy thing. if i ask a route from first point to last, gh says there’s no route. what am i missing ? here’s the code

      GraphHopper hopper = new GraphHopperOSM()
            .setOSMFile(f.getAbsolutePath())
            .setGraphHopperLocation(ghDir.getAbsolutePath())
            .setCHEnabled(false)
            .setEnableInstructions(false)
            .setMinNetworkSize(0,0)
            .setEncodingManager(new EncodingManager("car"))
            .forServer();

    hopper.getCHFactoryDecorator().setWeightingsAsStrings("shortest");

    hopper.clean();
    hopper.importOrLoad();


    double[] pointA = new double[]{45.38389351197, 10.87323666094};
    double[] pointC = new double[]{45.38455481936, 10.88175530464};


    GHRequest req = new GHRequest(pointA[0], pointA[1], pointC[0], pointC[1]);
    req.setAlgorithm(Parameters.Algorithms.DIJKSTRA_BI);
    req.setWeighting("shortest");
    req.setVehicle("car");


    req.getHints().put(Parameters.Routing.INSTRUCTIONS, "true");
    GHResponse resp = hopper.route(req);

and you can find the osm file here ( https://www.dropbox.com/s/3sg05h2ookh8qw3/simple-highway.osm?dl=0 )

Any ideas?


#2

Please share the exact error message. Also make sure the import went through without an error. See e.g. this import error.


#3

no error @karussell

 0    [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - version 0.8.0|2016-10-18T08:55:23Z (5,14,4,3,3,2)
10   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - graph car|RAM_STORE|2D|NoExt|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
39   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - start creating graph from /Users/alberto.cappellina/Desktop/graphoppertest/src/main/data/osm/aereo2.osm
39   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - using car|RAM_STORE|2D|NoExt|,,,,, memory:totalMB:245, usedMB:18
58   [main] INFO  com.graphhopper.reader.osm.OSMReader  - creating graph. Found nodes (pillar+tower):3, totalMB:245, usedMB:20
68   [main] INFO  com.graphhopper.reader.osm.OSMReader  - 4, now parsing ways
73   [main] INFO  com.graphhopper.reader.osm.OSMReader  - finished way processing. nodes: 2, osmIdMap.size:3, osmIdMap:0MB, nodeFlagsMap.size:0, relFlagsMap.size:0, zeroCounter:0 totalMB:245, usedMB:24
73   [main] INFO  com.graphhopper.reader.osm.OSMReader  - time pass1:0s, pass2:0s, total:0s
75   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - start finding subnetworks, totalMB:245, usedMB:24
75   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - edges: 1, nodes 2, there were -1 subnetworks. removed them => 0 less nodes
94   [main] INFO  com.graphhopper.storage.index.LocationIndexTree  - location index created in 0.016610483s, size:3, leafs:3, precision:300, depth:1, checksum:2, entries:[4], entriesPerLeaf:1.0
94   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - flushing graph car|RAM_STORE|2D|NoExt|5,14,4,3,3, details:edges:1(1MB), nodes:2(1MB), name:(1MB), geo:7(1MB), bounds:10.873236563948614,10.881755185464513,45.383893409011364,45.38455464805412, totalMB:245, usedMB:26)
114  [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - flushed graph totalMB:245, usedMB:29)

it simply does not find any path from start to end.

to be more precise,

List<PathWrapper> results = resp.getAll();

returns 0 results


#4

Try using a more recent version. 0.11 Just got out.


#5

thanks!

updated but still no path found.

0    [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - version 0.11.0|2018-09-14T10:56:40Z (5,14,4,3,3,2)
7    [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - graph car|RAM_STORE|2D|NoExt|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
40   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - start creating graph from /Users/alberto.cappellina/Desktop/graphoppertest/src/main/data/osm/aereo2.osm
40   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - using car|RAM_STORE|2D|NoExt|,,,,, memory:totalMB:245, usedMB:20
61   [main] INFO  com.graphhopper.reader.osm.OSMReader  - creating graph. Found nodes (pillar+tower):3, totalMB:245, usedMB:21
68   [main] INFO  com.graphhopper.reader.osm.OSMReader  - 4, now parsing ways
72   [main] INFO  com.graphhopper.reader.osm.OSMReader  - finished way processing. nodes: 2, osmIdMap.size:3, osmIdMap:0MB, nodeFlagsMap.size:0, relFlagsMap.size:0, zeroCounter:0 totalMB:245, usedMB:26
72   [main] INFO  com.graphhopper.reader.osm.OSMReader  - time pass1:0s, pass2:0s, total:0s
74   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - edges: 1, nodes 2, there were -1 subnetworks. removed them => 0 less nodes
92   [main] INFO  com.graphhopper.storage.index.LocationIndexTree  - location index created in 0.015563213s, size:3, leafs:3, precision:300, depth:1, checksum:2, entries:[4], entriesPerLeaf:1.0
93   [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - flushing graph car|RAM_STORE|2D|NoExt|5,14,4,3,3, details:edges:1(1MB), nodes:2(1MB), name:(1MB), geo:7(1MB), bounds:10.873236563948614,10.881755185464513,45.383893409011364,45.38455464805412, totalMB:245, usedMB:28)
106  [main] INFO  com.graphhopper.reader.osm.GraphHopperOSM  - flushed graph totalMB:245, usedMB:32)
found  0 paths
-=======================================-

#6

@karussell my bad i was catching an exception. we got back to the old issue

Point 1 is ouf of bounds: 45.38455481936,10.88175530464 

library is ignoring my bounds or it’s interpreting in wrong way.
this is bound printed out .

   bounds:10.873236563948614,10.881755185464513,45.383893409011364,45.38455464805412

this is bound expressend in OSM file

  <bounds minlat='45.3824413' minlon='10.871991' maxlat='45.39' maxlon='10.884' origin='JOSM' />

these are the points

 <node id='38978'  visible='true' version='1' lat='45.38389351197' lon='10.87323666094'/>
 <node id='38980'  visible='true' version='1' lat='45.38772586358' lon='10.87914666207'/> 
<node id='38982'  visible='true' version='1' lat='45.38455481936' lon='10.88175530464'/> 

what is wrong with it ?


#7

if anyone would like to help, i’ll leave the project for intellj here: https://www.dropbox.com/s/dj2l732fafy6mf0/graphopper-test.zip?dl=0


#8

@karussell @alberto.cappellina we are facing same issue if you guy’s getting any solution please let us know… thanks :slight_smile:


#9

@karussell Below is screen shot of exported area from osm

This is the bounds which Graphhopper routing code interpreted