get_zone_data

The get_zone_data function is used to receive detailed information about geofences.

Copied!
svc=resource/get_zone_data&params={"itemId":<long>,
				   				   "col":[<long>],
				   				   "flags":<uint>}

Parameters

NameDescription
itemIdResource ID.
col

The array of geofence IDs.

The field is optional. If it is not present, the function is executed for all IDs.

flagsThe flags that determine the format of the returned JSON (optional). The default value is 0x1C.

The following flag values are available:

ValueDescription
0x01Area.
0X02Perimeter.
0X04The coordinates of the centre and the limits of the geofence.
0X08All points.
0X10Basic properties.

Returned result

Copied!
[						/* 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, 0ID 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”):

ValueDescription
0x20Show shape.
0X40Not simplify the geofence.

Possible error codes:

CodeDescription
7Failed 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).
4Wrong input parameters.
Download PDF file
Download Word document

See also