Fence Geotrigger

A condition which monitors the dynamic elements of the geotrigger feed for enter/exit against the fences defined by the Fence Parameters

Referenced by: Geotrigger

Properties

Property Details
enterExitRule The rule that determines whether a fence polygon has been entered or exited by the geometry from a feed. If this value is 'enterIntersectsAndExitDoesNotIntersect', a fence polygon is entered when it intersects a feed geometry and exited when it no longer intersects. If this value is 'enterContainsAndExitDoesNotContain', a fence polygon is entered when it contains a feed geometry and exited when it is no longer contained. If this value is 'enterContainsAndExitDoesNotIntersect' a fence polygon is entered when it contains a feed geometry and exited when it no longer intersects. If not set, the default behavior is enterContainsAndExitDoesNotIntersect. The 'feedAccuracyMode' must be set to 'useGeometryWithAccuracy' for this property to have an effect.
Valid values:
  • enterContainsAndExitDoesNotContain
  • enterContainsAndExitDoesNotIntersect
  • enterIntersectsAndExitDoesNotIntersect
feed The feed for this Geotrigger.
Must be one of the following values:
feedAccuracyMode Indicates how the geotrigger will use accuracy information from a feed. If this value is 'useGeometry', the reported geometry from a feed will be used. If this value is 'useGeometryWithAccuracy' the feed geometry will be used in conjunction with accuracy information. If not set, the default behavior is useGeometry.
Valid values:
  • useGeometry
  • useGeometryWithAccuracy
fenceNotificationRule Indicates the type of event that will trigger notifications for the Fence Geotrigger. For example, a value of 'enter' will result in notifications when the geometry of the feed enters a fence polygon.
Valid values:
  • enter
  • enterOrExit
  • exit
fenceParameters An object defining the fences to use for this Geotrigger.
Must be one of the following values:
name The name for this Geotrigger.
notificationOptions Options that control the notification information sent to a client app when a Geotrigger condition is met.
type String indicating the Geotrigger condition type.
Valid value of this property fence

Fence Geotrigger Example

{
  "type": "fence",
  "name": "Example Geotrigger - Notify when I am within 50m of my target areas.",
  "feed": {
    "type": "deviceLocation",
    "filterExpression": {
      "title": "Location filter",
      "expression": "return $locationupdate.horizontalaccuracy <= 20"
    }
  },
  "fenceNotificationRule": "enter",
  "feedAccuracyMode": "useGeometryWithAccuracy",
  "enterExitRule": "enterIntersectsAndExitDoesNotIntersect",
  "fenceParameters": {
    "type": "features",
    "bufferDistance": 50,
    "fenceSource": {
      "layerUrl": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer/0",
      "type": "featureLayer"
    },
    "filter": {
      "where": "facility = 6",
      "geometry": {
        "x": 13871520.850500003,
        "y": 3910293.086000003,
        "spatialReference": {
          "wkid": 102100,
          "latestWkid": 3857
        }
      }
    }
  },
  "notificationOptions": {
    "expressionInfo": {
      "title": "Expression",
      "expression": "'You have entered' + $fencefeature.AREA_NAME"
    }
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.