One can specify a geofence as a circle, as a polygon or as POI (Point of Interest). One can also assign a name and a description to each geofence to help identify them.
Circle
Specify coordinates of the center point of the circle and a radius in meters.
{
"name": "Home",
"type": "circle",
"definition": {
"center": {
"lat": 52.5308398,
"lng": 13.38490035
},
"radius": 100
},
"description": "Small area around my house."
}
Polygon
Specify an array of points. A minimum of three points is required.
NOTE: If the array of points does not describe a closed polygon, the polygon is automatically closed between the last and first points.
{
"name": "Work",
"type": "polygon",
"definition": {
"points": [{
"lat": 52.5308398,
"lng": 13.38490035
}, {
"lat": 52.530443,
"lng": 13.38482003
}, {
"lat": 52.5308298,
"lng": 13.38492235
}]
},
"description": "The area around work."
}
Indoor geofence
Circular and polygonal geofences can be both outdoors and indoors.
To create a circular indoor geofence, add the floor property to the request body.
{
"name": "Office indoor",
"type": "circle",
"definition": {
"center": {
"lat": 52.5308398,
"lng": 13.38490035
},
"radius": 20,
"floor": {
"level": 2,
"id": "DM_1234",
"name": "Office floor 2"
}
},
"description": "Floor 2 of the office."
}
POI geofence
Specify location details of a POI geofence for its initial creation.
After the POI geofence has been created, it will need to be trained. The POI geofence boundary is defined using radio measurements. The POI geofence is trained using a telemetry that a device has ingested while being at this desired point of interest.
For a trained POI geofence, an associated device is considered to be inside the geofence when the radio measurements of the device-ingested telemetry and the training data match.
{
"name": "POI room in the office",
"type": "poi",
"definition": {
"location": {
"room": ROOM_201,
"address": Invalidenstrasse 116,
"country": Germany,
"position": {
"lat": 52.5308398,
"lng": 13.38490035
}
},
"floor": {
"level": 2,
"id": "DM_1234",
"name": "Office floor 2"
}
},
"description": "A room where goods should be delivered."
}
Successful requests have the HTTP status 201 and the response body provides the ID of the created geofence.