Geofences: presence in geofences:

To find out if current point is inside certain geofences or to find nearest geofence, use the command resource/get_zones_by_point:

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

Parameters

Name Description
zoneId list of geofences {“resource id”:[geofence id,…], …}
lat latitude
lon longitude
radius geofences search radius, m

:!: If array of geofences IDs is empty it means that all geofences will be taken

Response

If the point is inside the geofence.

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

If the point is outside the geofence.

[
    {
	<text>:{		/* resource id */
	    <text>:<double>	/* geofence ID, distance to geofence, m */
	}
    }
]
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2021 Gurtam