Determine if a location is in specified geofence (InGeofence() function)

The InGeofence() function determines if a location is within a specified, circular geofence. Note that any location on the boundary is considered inside the geofence.

Format:

Boolean InGeofence(String center, Number radius, String location)

where:

center - latitude, longitude of the center of the geofence ; e.g., "42.3948532,-71.2938472".

radius - radius (miles) from the center - this defines the edge of the geofence.

location - location of the asset. For a MobileLocation trigger, you can specify an unqualified "location". For all other triggers, you need to qualify this as "Location.location".

 

Example:

The following expression returns true if the location is within 2.5 miles (the radius) of the given point.

If: InGeofence("42.3948532,-71.2938472", 2.5, Location.location)

 

See Also