2

I'm trying to find all paths between 2 nodes by using graphhopper but there is something wrong with my code. When remove setAlgorith line, it returns only one path but when I add setAlgorithm(Parameters.Algorithms.ALT_ROUTE), it returns 0 path. Here is my code:

GraphHopper graphHopper = new GraphHopper().forServer();
graphHopper.load("E:\\graphhopper\\[asia_vietnam].osm-gh");
GHRequest req = new GHRequest(21.006399, 105.820359, 21.022409, 105.819163).
                setAlgorithm(Parameters.Algorithms.ALT_ROUTE).
                setLocale(Locale.US);
GHResponse rsp = graphHopper.route(req);
List<PathWrapper> paths = rsp.getAll();
System.out.println(paths.size());

According to this post, it should return all possible path but seems like it doesn't work.

0 Answers0