route_response
A route_response
links back to a provided route by having the same id field. Otherwise,
it contains only derived values calculated by RouteCloud.
Name | Type | Description |
---|---|---|
cost | float | The projected cost of the route, derived from the route's cost_per_km, cost_per_hour, and fixed_cost. |
custom | custom | User-supplied custom fields that were sent in the request. |
distance_meters | float | The projected total distance of the route in meters. |
driving_time | timespan | The projected total time spent driving the route. |
id | id | The ID of the route that was provided in the request on route.id |
internal_cost | float | The projected cost, including violations and intangibles, of the route. |
name | string | The name of the route that was provided in the request on route.name. |
next_multiday_day | id | The id of the route on the next day of this multi-day route. Unset if not part of a multi-day route, or if this is the last day. |
planned_start_date_time | datetime | The projected start time of the route. |
previous_multiday_day | id | The id of the route on the previous day of this multi-day route. Unset if not part of a multi-day route, or if this is the first day. |
stops | stop_response[] | The stops the route visits. Each stop can be of type depot , break , or job . This is unset if a full request is returned; route.stops is set instead. See Full vs Partial Responses. |
vehicle | id | The vehicle assigned to this route, if any. See Routing with Vehicles. |
violations | violation[] | An array of the route-level violations detected on the route, if any. |
working_time | timespan | The projected total time taken to complete the route. |
Planned Start DateTime
The planned_start_date_time field represents the projected time that the route will begin.
- If enable_start_stem_time is
true
, the planned start time is taken from the arrival time at the start depot, or overnight stay in the case of multiday routes. - If enable_start_stem_time is
false
, the planned start time is taken from the arrival time at the first job. - In all cases, if optimize_start_time is
false
, the planned start time should be equal to the start_time on the route's date. Otherwise, the route may start later if doing so is more efficient. See Routing with Shifts.
Example
{
"id": "route0",
"cost": 63.54,
"distance_meters": 180318,
"driving_time": "02:46:18",
"internal_cost": 228.49,
"working_time": "04:58:12",
"stops": [
{
"depot": "16LMdTb8uUOSZ9UNOHVDsg_0",
"arrival_time": "09:00:00",
"time_on_site": "00:00:00",
"distance_to_meters": 0.0,
"time_to": "00:00:00",
"location": "39.718005,-104.969531",
"type": "depot",
"path_to_stop": []
},
{
"id": "job4",
"arrival_datetime": "2018-01-23T10:07:06",
"distance_to_meters": 25558,
"time_to": "00:30:32",
"time_on_site": "00:15:00",
"type": "job",
"path_to_stop": [
"39.718005,-104.969531",
"39.718182,-104.969529",
....
]
},
{
"depot": "16LMdTb8uUOSZ9UNOHVDsg_0",
"arrival_time": "13:06:00",
"time_on_site": "00:00:00",
"distance_to_meters": 6030.0,
"time_to": "00:12:36",
"location": "39.718005,-104.969531",
"type": "depot",
"path_to_stop": [
"39.708990,-105.026954",
"39.708567,-105.026956",
...
]
}
]
}
See Also
- The route type.
- The build_response.routes, sequence_response.routes, evaluate_response.routes, and recommend_option.routes fields.