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.FenceEnterExitSpatialRelationshipEnterIntersectsAndExitDoesNotIntersect | (0) The fence polygon is entered when it intersects a GeotriggerFeed entity and exited when it no longer intersects. This option tends to increase the number of notifications as an entity approaches a fence polygon. Use this option when you want to receive all possible notifications - for example, when you want to be warned that you are approaching a hazard. |
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.FenceEnterExitSpatialRelationshipEnterContainsAndExitDoesNotContain | (1) The fence polygon is entered when it contains the entity from a GeotriggerFeed and exited when the entity is no longer contained. This option limits notifications to when the entity is fully within the fence polygon. Use this option to be certain you are within a given fence - for example when carrying out work within a specific land parcel. |
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.FenceEnterExitSpatialRelationshipEnterContainsAndExitDoesNotIntersect | (2) The fence polygon is entered when it contains a GeotriggerFeed entity and exited when it no longer intersects. This option tends to minimize the number of notifications. The entity must be fully within the fence polygon to enter and must be fully outside to exit. This combination reduces the number of spurious notifications that occur as you move around the border of a fence. Use this option when you want to limit notifications - for example, when driving past properties on your way to a delivery address. |
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).