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);
I see. You want to force the route to visit P2,3,4,5 but they should not be included in the instructions? Can you not simply filter the instruction list and remove those waypoint_reached instructions? If that doesn’t work you need to change the server-side code accordingly. There is no configuration option that does this.