update_checkpoints

To update the list of the route checkpoints, use the update_checkpoints command:

Copied!
svc=route/update_checkpoints
params={
  "itemId": <long>,
  "checkPoints": [
    {}
  ]
}

Parameters

The request must contain the following parameters:

Parameter Description
itemID Route ID.
checkPoints Array of checkpoints.

The checkpoint format varies depending on the checkpoint type, that is, on whether it is a checkpoint from the map, a geofence or a unit.

Checkpoints from the map

The format of checkpoits from the map is as follows:

Copied!
{
  "f": 1,        // Point type.
  "n": <text>,   // Name.
  "y": <double>, // Latitude.
  "x": <double>, // Longitude.
  "r": <uint>    // Radius.
}

Checkpoints from geofences

For checkpoints from geofences, two formats are possible:

  • format 1: with the indication of the gz field, containing the geofence data;
  • format 2: with the indication of the resource ID and the geofence ID.

Format 1

Copied!
{
  "f": 2,        // Point type.
  "n": <text>,   // Name.
  "gz": {        // Geofence information.
    "n": <text>,     // Geofence name.
    "d": <text>,     // Geofence description.
    "id": <long>,    // Geofence ID.
    "t": <byte>,     // Geofence type: 1 = line, 2 = polygon, 3 = circle.
    "w": <uint>,     // Line width or circle radius.
    "f": <uint>,     // Geofence flags.
    "c": <uint>,     // Color (ARGB).
    "b": {           // Bounding box parameters.
      "min_x": <double>, // Minimum longitude.
      "min_y": <double>, // Minimum latitude.
      "max_x": <double>, // Maximum longitude.
      "max_y": <double>, // Maximum latitude.
      "cen_x": <double>, // Center longitude.
      "cen_y": <double>  // Center latitude.
    },
    "p": [           // Array of geofence points.
      {
        "x": <double>, // Longitude.
        "y": <double>, // Latitude.
        "r": <uint>    // Radius.
      }
    ]
  }
}

Format 2

Copied!
{
  "f": 2,                // Point type.
  "n": <text>,           // Name.
  "resource": <long>,    // ID of the resource containing the geofence.
  "zone": <long>         // Geofence ID within the resource.
}

Checkpoints from units

The format of checkpoits from units is as follows:

Copied!
{
  "f": 4,        // Point type.
  "u": <long>,   // Unit ID.
  "r": <uint>    // Radius.
}

Response

If the request is completed successfully, the response is returned in the following format:

Copied!
{
  "rpts": [                  // Array of checkpoints.
    {
      "n": <text>,           // Name.  
      "f": <uint>,           // Type.
      "u": <long>,           // Unit ID (0 if the type is not a checkpoint from a unit).
      "y": <double>,         // Latitude.
      "x": <double>,         // Longitude.
      "r": <uint>            // Radius.
    }
  ]
}

If the request fails, an error code is returned.

Error codes

Error Code Description
4 Invalid input parameters, or failed to update the checkpoints.
6 Failed to create the JSON writer (internal).
7

One of the following errors:

  • The item is not i_avl_route_control_plugin.
  • No ADF_ACL_AVL_ROUTE_EDIT_SETTINGS access right to the route.
  • Internal error.

If you find a mistake in the text, please select it and press Ctrl+Enter.

Report a mistake

Your message was sent. Thank you!

An error occurred while submitting the form

Download PDF file
Download Word document

See also