Estimated travel time between jobs using Geoservices
Skedulo uses the planr/geoservices/travel-time
endpoint to provide the estimated travel time between the resource’s home address and their scheduled jobs.
When a job is scheduled with a resource, the estimated travel time between their previous location and the job is indicated in the web application swimlane.
Resources that have a number of jobs scheduled throughout the day have travel times estimated between their home address and each job, and the return trip to their home address.
For example, the following jobs are scheduled throughout a single day and the swimlane shows the estimated time to travel between each job, represented as a line:
This estimation of travel time is based on the geolocation of the resource and their job location.
The first estimation is based on the distance between the resource’s home address and their first scheduled job. The next scheduled job shows the estimated travel time between its address geolocation and the geolocation of the previous job address, and so on.
Round trip results
The /planr/geoservices/travel-time
endpoint includes the option to ignore or include travel between the resource’s home address and their first and/or last scheduled job.
When the ignoreTravelTimeFirstJob
and ignoreTravelTimeLastJob
options are set to false
, the schedule is treated as a round trip, in that it will return the travel time between home and the first job as the first result, with the final result as the travel time between the final scheduled job and the resource’s home address.
The following query requests the approximate travel time for the resource to travel from their home location to the job:
{
"resources": [
{
"id": "0005a536-100b-4b25-865c-7a9640638773",
"origin": {
"lat": -27.346594,
"lng": 153.061081
},
"availabilities": [
{
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z"
}
]
}
],
"nodes": [
{
"id": "0014e946-d5e9-43f7-a969-79415889a140",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-12T23:56:34Z",
"end": "2019-09-13T23:56:34Z",
"lat": -27.456904,
"lng": 153.034927
}
],
"schedulingOptions": {
"balanceWorkload": false,
"minimizeResources": false,
"jobTimeAsTimeConstraint": true,
"preferJobTimeOverTimeConstraint": true,
"respectSchedule": true,
"ignoreTravelTimes": false,
"ignoreTravelTimeFirstJob": false,
"ignoreTravelTimeLastJob": false,
"padding": 0,
"snapUnit": 0,
"maxTravelTimeInMinutes": 0
}
}
This id
property for this node is the UID of the requesting system, in this case, we are using the UID of the job to determine the travel time between the job geolocation and the home address geolocation.
The following result shows the travel time in seconds between the resource’s home and the job location, then the travel time from the job location back to the resource’s home address:
{
"result": {
"0014e946-d5e9-43f7-a969-79415889a140": 1161,
"0005a536-100b-4b25-865c-7a9640638773": 1226
}
}
Travel times for an entire schedule
You can include multiple jobs and resources in the query to return travel times across a number of resources and scheduled jobs.
The following query estimates travel time for an entire work day for a single resource:
{
"resources": [
{
"id": "0005a536-100b-4b25-865c-7a9640638773",
"origin": {
"lat": -27.346594,
"lng": 153.061081
},
"availabilities": [
{
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z"
}
]
}
],
"nodes": [
{
"id": "0014a843-674c-45d5-a570-f3c2c975612c",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z",
"lat": -27.475101,
"lng": 153.025704
},
{
"id": "0014e946-d5e9-43f7-a969-79415889a140",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z",
"lat": -27.456904,
"lng": 153.034927
},
{
"id": "00140705-83ec-4d36-8964-8d649c61ad39",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z",
"lat": -27.434308,
"lng": 153.043408
},
{
"id": "0014e1a8-3c92-4a4c-a23b-db423b84f7b4",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z",
"lat": -27.348532,
"lng": 153.028094
},
{
"id": "00143c64-77e5-4bbd-b914-f3b881bee0cc",
"resourceId": "0005a536-100b-4b25-865c-7a9640638773",
"start": "2019-09-19T23:56:34Z",
"end": "2019-09-20T23:56:34Z",
"lat": -27.457051,
"lng": 153.040312
}
],
"schedulingOptions": {
"balanceWorkload": false,
"minimizeResources": false,
"jobTimeAsTimeConstraint": true,
"preferJobTimeOverTimeConstraint": true,
"respectSchedule": true,
"ignoreTravelTimes": false,
"ignoreTravelTimeFirstJob": false,
"ignoreTravelTimeLastJob": false,
"padding": 0,
"snapUnit": 0,
"maxTravelTimeInMinutes": 0
}
}
The result shows the travel time between home and the first job, then each subsequent job, and the final travel time back to the home address. Results are shown in seconds:
{
"result": {
"0014a843-674c-45d5-a570-f3c2c975612c": 1409,
"0014e946-d5e9-43f7-a969-79415889a140": 281,
"00140705-83ec-4d36-8964-8d649c61ad39": 343,
"0014e1a8-3c92-4a4c-a23b-db423b84f7b4": 1035,
"00143c64-77e5-4bbd-b914-f3b881bee0cc": 1104,
"0005a536-100b-4b25-865c-7a9640638773": 1235
}
}
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.