When determining whether a feed entity has entered or exited a fence polygon, there are two spatial operations that can be used:
- Intersects: the feed geometry must intersect the fence polygon.
- Contains: the feed geometry must be contained by the fence polygon.
These operations determine whether a fence polygon has been entered, and also when it has been exited (the feed geometry no longer intersects or is no longer contained by the fence polygon). Because the contains condition is more strict than intersects (a geometry can intersect another geometry without being contained by it) it tends to result in fewer notifications when the two geometries are nearby. By using different combinations of these rules for enter and exit, you can control the likelihood that notifications will be sent.
Note that when the feed geometry is a Point, there is no difference between intersection and containment, so both options behave the same. When using a LocationGeotriggerFeed, set FenceGeotrigger::feedAccuracyMode to Enums.FenceGeotriggerFeedAccuracyModeUseGeometryWithAccuracy in order to create a polygon geometry that accounts for the area of uncertainty around a Location::position.
The FenceEnterExitSpatialRelationship can be one of:
Constant | Description |
---|---|
Enums. | (0) The fence polygon is entered when it intersects a Geotrigger |
This option has no effect unless the feed entity geometry is a Polygon. Set FenceGeotrigger::feedAccuracyMode to Enums.FenceGeotriggerFeedAccuracyModeUseGeometryWithAccuracy to create a polygon geometry that accounts for the area of uncertainty around a Location::position.
In the diagram above, the feed enters the fence on the left (shown in yellow) and exits on the right (shown in purple).
Constant | Description |
---|---|
Enums. | (1) The fence polygon is entered when it contains the entity from a Geotrigger |
This option has no effect unless the feed entity geometry is a Polygon. Set FenceGeotrigger::feedAccuracyMode to Enums.FenceGeotriggerFeedAccuracyModeUseGeometryWithAccuracy to create a polygon geometry that accounts for the area of uncertainty around a Location::position.
In the diagram above, the feed enters the fence on the left (shown in yellow) and exits on the right (shown in purple).
Constant | Description |
---|---|
Enums. | (2) The fence polygon is entered when it contains a Geotrigger |
This option has no effect unless the feed entity geometry is a Polygon. Set FenceGeotrigger::feedAccuracyMode to Enums.FenceGeotriggerFeedAccuracyModeUseGeometryWithAccuracy in order to create a polygon geometry that accounts for the area of uncertainty around a Location::position.
In the diagram above, the feed enters the fence on the left (shown in yellow) and exits on the right (shown in purple).