get_zones_by_point

The get_zones_by_point function is used to check if a point is inside certain geofences or to find the nearest geofence.

Copied!
svc=resource/get_zones_by_point&params={"spec": {
										"lat":<double>,
										"lon":<double>,
										"radius":<double>,
										"zoneId":{
													"<long>":[<uint>,
														...
													],
												...
											},
										 }
										}

Parameters

NameDescription
zoneIdThe list of geofences: {“resource ID”:[geofence ID,…], …}.
latLatitude.
lonLongitude.
radiusThe geofences search radius, m. Optional field.
If the array of geofence IDs for the indicated “resource ID” is empty, all the resource geofences are taken.

Returned result

If the point is inside the geofence, the returned result is:

Copied!
[ 
	{ 
		"<text>": {	/* resource ID */ 
			"<text>": 0,	/* geofence ID, the distance to the geofence, m (always 0 in this case) */ 
			...
		},
		...
	}
]

If the point is outside the geofence, the returned result is:

Copied!
[ 
	{ 
		"<text>":{	/* resource ID */ 
			"<text>": <double>,	/* geofence ID, distance to geofence, m */ 
		}
	}
]

If there is no radius field, the returned result is:

Copied!
[ 
	{ 
		"<text>": [	/* resource ID */ 
			<long>,	/* geofence IDs */ 
			...
		],
		...
	}
]

Possible error codes:

CodeDescription
6General error.
4Wrong input parameters.
Download PDF file
Download Word document

See also