Menu CommandsClientsDocumentationDocsGithubLicense
Tile38

Geofencing

Geofence animation A geofence is a virtual boundary that can detect when an object enters or exits the area. This boundary can be a radius or any search area format, such as a bounding box, GeoJSON object, etc. Tile38 can turn any standard search into a geofence monitor by adding the FENCE keyword to the search.

A simple example:

NEARBY fleet FENCE POINT 33.462 -112.268 6000

This command opens a geofence that monitors the fleet collection. The server will respond with:

{ "ok": true, "live": true }

And the connection will be kept open. If any object enters or exits the 6 km radius around 33.462,-112.268 the server will respond in realtime with messages such as:

{ "command": "set", "detect": "enter", "hook": "warehouse", "time": "2016-03-20T09:37:49.567854293-07:00", "key": "fleet", "id": "truck02", "object": { "type": "Point", "coordinates": [-112.2695, 33.4626] } }

The server will notify the client if the command is del or set or drop.

The detect may be one of the following values.

By default all detect types and commands are returned. If you would like to only have a select few then use the DETECT option, for example:

NEARBY fleet FENCE DETECT inside,outside POINT 33.462 -112.268 6000

This command will only tell the fence that you only want inside and outside detection.

It’s also possible to mask which commands are returned by using the COMMANDS option, for example:

NEARBY fleet FENCE DETECT enter COMMANDS set POINT 33.462 -112.268 6000

This specifies that you only want the enter detection for the set command.




Star