Routing with Linked Stops
Linked stops represent a pair of stops that a driver must travel to in succession. Linked stops are assigned by specifying an exit_location on a job, representing the location that the driver must travel to immediately after leaving the job's location.
Linked stops are useful if a driver must pick something up in one location, and immediately drop it off in another location.
Note
To run the examples in this tutorial, you will need:
- A RouteCloud API login. Use your Verizon Connect Enterprise username and password to authenticate with the RouteCloud API. To obtain a username and password, contact Verizon Connect sales.
- cURL to run the requests. You can download a cURL binary from here.
Request
{
"routes": [
{ "id": "route0", "location": "39.718005, -104.969531" }
],
"jobs": [
{ "id": "job0", "time_on_site": "00:10", "location": "39.635928, -105.049219" },
{
"id": "job1",
"time_on_site": "00:10",
"location": "39.727919, -105.103126",
"exit_location": "39.638635, -105.128906"
},
{
"id": "job2",
"time_on_site": "00:10",
"location": "39.597111, -105.041015",
"exit_location": "39.727919, -105.103126",
"exit_time_on_site": "00:15"
}
]
}
routing_with_linked_stops_build.json
build request - download it here. Click here to open it in the UI.
routing_with_linked_stops_build.json
specifies one route and three jobs.
job0
is a regular job with a single location.
job1
and job2
both specify an exit_location, meaning that this location must be visited before proceeding with any other jobs.
Response
{
"routes": [
{
"id": "route0", ...
"stops": [
{ "type": "depot", ... },
{ "job": "job1", "type": "job", ... },
{ "previous_job": "job1", "type": "job_exit", ... },
{ "job": "job0", "type": "job", ... },
{ "job": "job2", "type": "job", ... },
{ "previous_job": "job2", "type": "job_exit", "time_on_site": "00:15:00" ... },
{ "type": "depot", ... }
]
}
],
"unrouted_jobs": []
}
A snipped version of the build response - download a copy here. Click here to open it in the UI.
The resulting stop sequence contains a job_exit
type stop for both job1
and job2
, immediately after the job
stop for the respective job.
The job_exit
stop for job2
has a time_on_site value of 00:15:00
, the value of the job's exit_time_on_site.
See Also
- The job.exit_location field.
- The job.exit_time_on_site field.
- The job_exit stop type.