Sequence First / Last

We need to specify a specific first stop or specific last stop. Can anyone provide help with the proper API call in the Route Optimizer?

You can use the relations feature with the special service ID start or end:

{
   "type": "in_direct_sequence",
   "ids": ["start","serv_i_id"]
}

Or:

{
   "type": "in_direct_sequence",
   "ids": ["serv_k_id","end"]
}

See the documentation and read the section starting with:

Special IDs: If you look at the previous example and you want service i to be the first in the route, use the special ID start as follows:…

Thank you!

1 Like