Search…
Route limits
You will learn the basics of using route limits on cloud.
Route limits are useful when constraining routes for individual or all vehicles. These limits are so-called hard constraints, hence, the limits cannot be exceeded by the routes they are applicable to.

Max stops

It may be useful to limit the number of stops in a route to a particular amount. This can simply be done with the max_stops attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
// Limit number of stops for this vehicle to 3
12
"max_stops": 3
13
},
14
{
15
"id": "vehicle-2",
16
// Limit number of stops for this vehicle to 2
17
"max_stops": 2
18
}
19
],
20
"stops": [
21
{ "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
22
{ "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
23
{ "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
24
{ "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
25
{ "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
26
]
27
}
Copied!

Max distance

It may be useful to limit the distance a vehicle can travel. For example, if the vehicle has a limited range. This limit can be set via the max_distance attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings. The distance is given in meters.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
// Limit distance of route for this vehicle to 2km
12
"max_distance": 2000
13
},
14
{
15
"id": "vehicle-2",
16
// Limit distance of route for this vehicle to 3km
17
"max_distance": 3000
18
}
19
],
20
"stops": [
21
{ "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
22
{ "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
23
{ "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
24
{ "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
25
{ "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
26
]
27
}
Copied!

Max duration

It may be useful to set a hard limit on the maximum duration of a route for a vehicle. For example, if the vehicle or vehicle driver has a limited availability. This limit can be set via the the max_duration attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings. The duration is given in seconds.
Note, there is a known accuracy issue in ETAs when combining hard_window & max_duration. We are working on a fix for this.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
// Limit duration of route for this vehicle to 4 minutes (240s)
12
"max_duration": 240
13
},
14
{
15
"id": "vehicle-2",
16
// Limit duration of route for this vehicle to 5 minutes (300s)
17
"max_duration": 300
18
}
19
],
20
"stops": [
21
{ "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
22
{ "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
23
{ "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
24
{ "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
25
{ "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
26
]
27
}
Copied!
Export as PDF
Copy link