Geofence Context

  • A very handy API handle to perform various geo query operations across geofences
  • Context Variable: geofence

API Interface

//Retrieve a geofence by name/ID
Geofence get(String name);

//Generic builder, supported types [POINT, ENVELOPE, CIRCLE, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION]
GeofenceBuilder builder(String type);

//Delete a geofence by name/ID
boolean delete(String name);

//Search geofences
List<Geofence> search(String query);

//Delete all geofences
int purge();

//Create a polygon geofence with a hole area inside it
PolygonHoleBuilder createPolygonHole(String geofenceName);

//Create a polygon geofence with a hole area inside it using array of coordinates for both fence and hole
PolygonHoleBuilder createPolygonHole(String geofenceName, Double[][] points, Double[][] holePoints);

//Create a polygon geofence using array of coordinates
PolygonBuilder createPolygon(String geofenceName, Double[][] points);

//Create a polygon geofence
PolygonBuilder createPolygon(String geofenceName);

//Create a patch geofence
PathBuilder createPath(String geofenceName);

//Create a patch geofence using array of coordinates
PathBuilder createPath(String geofenceName, Double[][] points);

//Creates a line geofence
LineBuilder createLine(String geofenceName);

//Creates a line geofence
LineBuilder createLine(String geofenceName, Double[] bLonlat, Double[] eLonlat);

//Create a circile geofence with raius in meters
CircleBuilder createCircle(String geofenceName, double longitude, double latitude, int radius);

//Create a circile geofence with raius and unit [mi (miles), yd (yard), ft (feet), in (inches), km (kilometer), m (meter) , cm (centimeter), mm (millimeter), nmi (nautical miles)]
CircleBuilder createCircle(String geofenceName, double longitude, double latitude, int radius, String unit);

//Create a point geofence
PointBuilder createPoint(String geofenceName, double longitude, double latitude);

//Set the context to Global access
void setGlobal();

//Set the context to System access
void setSystem();

//Set the context tied to an organization
void setOrganization(long orgId);

//Set the context back to normal (Domain) mode
void resetMode();

//Set the context to another domain
boolean switchDomain(String domainKey);

//Set the context back to original Domain
void resetDomain();

APIs Inherited From

Context Base

Examples

Related REST APIs

Create / Update Geofence
Search Geofences
Delete Geofence
Delete All Geofences
Clear All Geofences
Create / Update Geofence Property
Retrieve Geofence Property
List Geofence Properties
Delete Geofence Property