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?