Dear friends I’m working on a Android applicazione and I’m trying to calculate the best route using from 10 to 15 points.
In this way i’m using each points like waypoints and then the response is composed from multiple legs and the my instructions are worng.
I would like to pass all points in request but i need to use only the first and the last point like wayPoint this will allow me to get a single leg with correct instruction
My request actually is the following:
GHRequest req = new GHRequest().setAlgorithm(Parameters.Algorithms.DIJKSTRA_BI);
req.setProfile("car");
LatLng ll;
for (int i = 0; i < waypointList.size(); i++) {
ll = waypointList.get(i);
req.addPoint(new GHPoint(ll.getLatitude(), ll.getLongitude()));
}
List<Double> head = new ArrayList<>();
head.add(dir);
req.getHints().put("ch.disable","true");
req.setHeadings(head);
req.getHints().put("instructions", "true");
GHResponse resp = hopper.route(req);
Can you give me some suggestion about this?