POST Derived Route

The /derivedRoute/routePath POST request estimates the route a vehicle took based on a series of longitude/latitude coordinates (usually pings from the vehicle). The function works this way:

  1. PC*MILER generates a route between the origin and destination.
  2. The latitude/longitude pings are compared with that route.
  3. Any pings that fall outside of the distance set in the offRouteMiles parameter are considered significant, and the route is reshaped to incorporate them.
  4. The estimated route is returned as a list of trip coordinates in GeoJSON format.

(Note: Requires a license for access to Trimble MAPS JavaScript.)

Request URL

POST https://pcmiler.alk.com/apis/rest/v1.0/Service.svc/derivedRoute/routePath?dataset={dataset}

Request Element

The PostDerivedRoutePath operation requires a JSON formatted ReduceTripRequestBody object in the POST body.

ElementDefinitionRequired
ReduceTripRequestBodyA ReduceTripRequestBody System Object. It contains a collection of trip pings, value for the off route miles, value indicating highway only options, and the report type to return.Y
RegionalDataSetThe regional dataset. Possible value: Current (default), PCM_EU, PCM_OC, PCM_SA, PCM_AF, PCM_AS, PCM_ME, PCM_GT, PCM_WW and PCM_NA.Y

Sample JSON Post Body

{
  "ExtendedOptions": {
    "EstimatedTimeOptions": {
      "ETAETD": 1,
      "DateOption": 1,
      "DateAndTime": {
        "CalendarDate": "4/23/2014",
        "DayOfWeek": 0,
        "TimeOfDay": "6:00 AM",
        "TimeZone": 0
      }
    },
    "TruckStyle": 0,
    "UseTraffic": true
  },
  "HighwayOnly": false,
  "OffRouteMiles": 0,
  "Region": 4,
  "ReportTypes": null,
  "RoutePings": [
    {
      "Lat": "33.714154",
      "Lon": "-118.309434"
    },
    {
      "Lat": "33.711154",
      "Lon": "-118.304434"
    }
  ],
  "RoutingOptions": {
    "AFSetIDs": null,
    "BordersOpen": true,
    "ClassOverrides": 0,
    "DistanceUnits": 0,
    "ElevLimit": null,
    "FerryDiscourage": false,
    "FuelRoute": false,
    "HazMatType": 0,
    "HighwayOnly": false,
    "HoSOptions": null,
    "HubRouting": false,
    "OverrideRestrict": false,
    "RouteOptimization": 0,
    "RoutingType": 0,
    "TollDiscourage": false,
    "TruckCfg": {
      "Axles": 5,
      "Height": "13'6\"",
      "LCV": false,
      "Length": "48'0\"",
      "Units": 0,
      "Weight": "80000",
      "Width": "96\""
    },
    "UseAvoidsAndFavors": false,
    "VehicleType": 0,
    "SideOfStreetAdherence": 0
  }
}

Sample Response

{
  "type": "Feature",
  "geometry": {
    "type": "MultiLineString",
    "coordinates": [
      [
        [-118.309434, 33.714154],
        [-118.30895, 33.714017],
        [-118.307977, 33.713744],
        [-118.307009, 33.71347],
        [-118.306045, 33.713216],
        [-118.305566, 33.713081],
        [-118.305495, 33.713057],
        [-118.305349, 33.712976],
        [-118.305143, 33.712807],
        [-118.30508, 33.712769],
        [-118.304701, 33.71257],
        [-118.30424, 33.712379],
        [-118.303813, 33.712205],
        [-118.304434, 33.711154]
      ]
    ]
  },
  "TMinutes": 0,
  "TDistance": 0
}