1

Retrieving Nearest Geofences

Тема: Retrieving Nearest Geofences

Hello,

Is there a way to retrieve all nearby geofences from specific coordinates, I tried to use resource/get_zones_by_point API but it does not retrieve all Geofences only nearest one

2

Retrieving Nearest Geofences

Re: Retrieving Nearest Geofences

mabed пишет:

Hello,

Is there a way to retrieve all nearby geofences from specific coordinates, I tried to use resource/get_zones_by_point API but it does not retrieve all Geofences only nearest one

Hello, yes, this request can show only closest geofence, not all geofences inside the indicated area.
Depends on the number of the resources and geofences, you can try to use core/batch request to pass several requests as one with different resources ID for each request, for example:
https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&params={"params":[{"svc":"resource/get_zones_by_point","params":{"spec":{"zoneId":{"RESOURCE_ID_1":[]},"lat":25.753,"lon":80.22222,"radius":100000}}},{"svc":"resource/get_zones_by_point","params":{"spec":{"zoneId":{"RESOURCE_ID_2":[]},"lat":25.753,"lon":80.22222,radius":100000}}},{"svc":"resource/get_zones_by_point","params":{"spec":{"zoneId":{"RESOURCE_ID_3":[]},"lat":25.753,"lon":80.22222,"radius":100000}}}],"flags":0}&sid=

Thus you will get closest geofence from each indicated resource.

Anton Zinovyev
Technical Care Engineer (L2)
Wialon