get_zone_data
The get_zone_data function is used to receive detailed information about geofences.
svc=resource/get_zone_data¶ms={"itemId":<long>,
"col":[<long>],
"flags":<uint>}
Parameters
Name | Description |
---|---|
itemId | Resource ID. |
col | The array of geofence IDs. The field is optional. If it is not present, the function is executed for all IDs. |
flags | The flags that determine the format of the returned JSON (optional). The default value is 0x1C. |
The following flag values are available:
Value | Description |
---|---|
0x01 | Area. |
0X02 | Perimeter. |
0X04 | The coordinates of the centre and the limits of the geofence. |
0X08 | All points. |
0X10 | Basic properties. |
Returned result
[ /* the array with data about geofences */
{
"n":"<text>", /* geofence name */
"d":"<text>", /* description */
"id":<long>, /* geofence ID in the resource/account */
"rid":<long>, /* resource/account ID */
"t":<byte>, /* type: 1 — line, 2 — polygon, 3 — circle */
"w":<uint>, /* line thickness or circle radius */
"f":<uint>, /* geofence flags (see below) */
"c":<uint>, /* colour (ARGB) */
"tc":<uint>, /* text colour (RGB) */
"ts":<uint>, /* font size */
"min":<uint>, /* show on map starting with this zoom */
"max":<uint>, /* show on map until this zoom */
"i":<ushort>, /* the check sum of the image (CRC16) */
"icon":"<text>", /* zone item image URI */
"path":"<text>", /* short path to the default icon */
"ar":<double>, /* area */
"pr":<double>, /* perimeter */
"libId":<long>, /* icon library ID, 0 — ID of the default icon library */
"jp":<JSON>, /* custom JSON */
"b":{ /* limits */
"min_x":<double>, /* minimum longitude */
"min_y":<double>, /* minimum latitude */
"max_x":<double>, /* maximum longitude */
"max_y":<double>, /* maximum latitude */
"cen_x":<double>, /* the longitude of the centre */
"cen_y":<double> /* the latitude of the centre */
},
"p":[ /* the array of geofence points */
{
"x":<double>, /* longitude */
"y":<double>, /* latitude */
"r":<uint> /* radius */
},
...
],
"ct":<uint>, /* creation time */
"mt":<uint> /* the previous modification time */
},
...
]
Geofence flags (“f”):
Value | Description |
---|---|
0x20 | Show shape. |
0X40 | Not simplify the geofence. |
Possible error codes:
Code | Description |
---|---|
7 | Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_VIEW_ZONES and ADF_ACL_ITEM_EXECUTE_REPORTS), or failed to fetch the unit with the desired ACL (ADF_ACL_ITEM_VIEW). |
4 | Wrong input parameters. |