8.0 Set waypoints

Hello, at present, I have a requirement for the project I am doing again, which is to set up several route points between the starting point and the end point for route planning, but in the process of using it, there is an error, and the error is as follows:
Currently alternative routes work only with start and end point

Here’s how to use it:
GHPoint start = new GHPoint(31.783791,111.519988);
GHPoint tjd = new GHPoint(31.760744,111.449359);
GHPoint end = new GHPoint(31.797762,111.417322);
req.putHint(Parameters.CH.DISABLE, true);

Currently I am using version 8.0

Please give a hint from the great god

The method I’m using now is:
GHRequest req = new GHRequest().setAlgorithm(Parameters.Algorithms.ALT_ROUTE
But when I get rid of this method, it’s okay …

1 Like

I see, there is no alternative route when there is a waypoint.
But when I want to set up a route area, how do I set it up?

Routing with alternatives does not support via-points currently. Does this answer your question?

I would also like to ask, if I only want the planning of the starting and ending points to be within a certain range, how do I need to set them?

yes. i know.
If I want the recommended route for the waypoint, then I need to set the waypoint as the endpoint for planning, and then set the waypoint as the starting point for planning. However, if I only have one waypoint, it’s okay to say, but if there are two waypoints, it’s a combination of n * n * n. This is not what I want, so this setting is not allowed. Thank you for your help. Thank you very much

you can use jsprit to solve simple TSP

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.