Estimate travel times between work items (deprecated)

Using the Planr Geoservices endpoint to approximate resource travel time.

Skedulo uses the planr/geoservices/travel-time endpoint to provide the estimated travel time between the resource’s home address and the first scheduled work item they are allocated to, as well as between subsequent work item locations and back to their home address.

The estimated travel times are indicated in the web application swimlane views by small lines preceding each work item.

Estimated travel time on swimlane

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
  }
}