Skip To Content

Spatial filters

Spatial filters in an ArcGIS GeoEvent Server service filter event data based on a spatial relationship with a geofence. Spatial filters are used to identify when event data is inside or outside a geofence. The geometries specifying a geofence must be imported into GeoEvent Server from a published feature service before a spatial filter can be configured.

Learn more about event data

The following spatial operators are supported:

  • INSIDE—An event's geometry is considered to be inside a geofence if its geometry is entirely within the area defined by the geofence. This operator determines whether a point associated with an event is inside an area of interest.
  • OUTSIDE—An event's geometry is considered to be outside a geofence if its geometry is entirely outside the area defined by the geofence. This operator determines whether a point associated with an event is outside an area of interest.

    Event data on two tracks inside and outside of a geofence

  • ENTER—An event's geometry is considered to have entered a geofence if its geometry is inside the area defined by the geofence, when the previous event position, from the same track, was outside the geofence. After an ENTER condition is detected and the event record is allowed to pass through the filter, the tracked object must report at least one event outside the geofence before another ENTER condition is recognized.
  • EXIT—An event's geometry is considered to have exited a geofence if its geometry is outside the area defined by the geofence, when the previous event position, from the same track, was inside the geofence. After an EXIT condition is detected and the event record is allowed to pass through the filter, the tracked object must report at least one event inside the geofence before another EXIT condition is recognized.
    Note:

    The spatial filter configured with an EXIT condition behaves slightly differently than the Incident Detector Processor. When evaluating its closing condition, the Incident Detector Processor reports the Ended status with the last observed geometry inside a geofence. The spatial filter allows an event record to pass through the filter if its geometry is outside a geofence when the EXIT condition evaluates as true.

    Learn more about how the EXIT condition behaves differently when used in the spatial filter compared to the Incident Detector Processor on the Esri Community page

    Event data meets the enter and exit conditions on two tracks

Typically, a set of geofences define areas of interest and are imported from a feature service providing polygon features. Geofences do not always have to represent polygonal areas; they can be imported from point and line features as well.

The spatial operators below can be used with different types of geometries. These spatial operators return a Boolean, indicating whether the described relationship exists between a geofence and an event's geometry. Some relationships require that an event's geometry have the same dimension as the geofence that it is being compared to, while others have more flexible dimensional constraints. Many of the spatial operators below are mutually exclusive Clementini operators.

  • CONTAINS—An event's geometry contains a geofence if the geofence is a subset of the event's geometry and the intersection of the two geometries is not empty. CONTAINS is the logical opposite of WITHIN.
    Note:

    It is not possible for a point geometry to contain a polyline or polygon, so it is not possible for a point associated with an event to contain a line or area imported as a geofence. It is possible for a point to contain a point or a line to contain a line, but testing for such a spatial relationship is not recommended. Trivial differences in a geometry due to projection may result in a point or line you expect to be coincident with a geofence not actually being perfectly coincident (in which case the CONTAINS relationship is evaluated as false).

    CONTAINS spatial operator examples

  • CROSSES—An event's geometry crosses a geofence if an intersection exists in a geometry of a lesser dimension. Two polylines cross if they intersect at one or more points and at least one point is not an endpoint. A polyline and a polygon cross if they share a polyline or a point on the interior of the polygon that is not equivalent to the entire polyline. CROSSES only applies to polyline/polyline, polyline/polygon, or polygon/polyline relations. If either one of the geometries is empty, the geometries do not cross.

    CROSSES spatial operator examples

  • DISJOINT—An event's geometry is considered to be disjointed from a geofence if the two geometries do not intersect. An event's geometry can be disjointed from one geofence while it intersects another geofence. When specifying a spatial expression, define the event's geometry, the scope (either any or all), and a set of geofences identified using a regular expression pattern match (for example, SomeCategory/.*) for accurate results.

    DISJOINT spatial operator examples

  • EQUALS—An event's geometry equals a geofence's geometry if their symmetric difference is the empty set. For geometries, the symmetric difference refers to the parts of each geometry that do not overlap with the other. If the symmetric difference between an event's geometry and geofence's geometry is the empty set, it means there are no differences between them, making them equal. If you were to iterate over each segment in each geometry and compare the segment's type and coordinates, and found they were the same (using the spatial reference's cluster tolerances to determine equality of coordinates), the two geometries would be considered equal.

    EQUALS spatial operator examples

  • INTERSECTS—An event's geometry intersects a geofence if the two geometries are not disjointed. INTERSECTS is the logical opposite of DISJOINT. An event's point that is within a geofence's area (polygon) also intersects the geofence. An event's polyline or polygon can intersect a geofence without being entirely within the geofence. An event's geometry can intersect one geofence within a set of geofences and still be DISJOINT ANY (for example, disjoint one or more). The event's geometry is not DISJOINT ALL since it intersects at least one of the geofences in the set.
  • OVERLAPS—An event's geometry overlaps a geofence if an intersection exists whose dimension is the same as the geometries being considered, and the intersection is not equivalent to either the event's geometry or the geofence. OVERLAPS only applies to polyline/polyline, polygon/polygon, and multipoint/multipoint relations. If either one of the geometries is empty, the geometries do not overlap.

    OVERLAPS spatial operator examples

    Point geometries fail the equivalency condition, so an event's point location cannot overlap a geofence whose geometry is also a point.

  • TOUCHES—An event's geometry touches a geofence if an intersection exists and the interior of the intersection is empty. This means two geometries only touch at vertices that define the geometry, not at a points in between vertices. TOUCHES is undefined for point/point relations. If either one of the geometries is empty, the geometries do not touch.

    TOUCHES spatial operator examples

  • WITHIN—An event's geometry is considered to be within a geofence if the two geometries intersect and the intersection of their interiors is not empty. WITHIN is the logical opposite of CONTAINS.

    WITHIN spatial operator examples

Learn more about relational operators on the IRelationalOperator Interface API Reference page

Related topics