Skip To Content

Detect Incidents

Summary

Creates a new layer that detects features that meet a given condition.

Illustration

Detect Incidents workflow diagram
Detect Incidents workflow

Usage

  • Incidents are features that meet a specified condition.

  • Detect Incidents creates a new output. It will not modify the input.

  • Detect Incidents can be completed on tables, point, line, or area features. The input layer must be time enabled with features that represent an instant in time.

  • Only input features that have a time entry will be used. Any feature that does not have a time entry will be excluded.

  • Tracks are represented by the unique combination of one or more track fields. For example, if the fields flightID and Destination are used as track identifiers, the [ID007, Solden] and [ID007, Tokoyo] features would be in two separate tracks, since they have different values for the Destination field.

  • Expressions are created using Arcade expressions. A start condition is required, and an end condition is optional.

    If you only apply a start condition, the incident starts when the start condition is evaluated as true, and ends when the start condition is evaluated as false. For example, if values in a track are [0, 10, 15, 20, 40, 10, 12, -2, -12] and the start condition is $feature["values"] > 15 the features that are incidents are those with [True] and would be [0: False, 10: False, 15: False, 20: True, 40: True, 10: False, 12: False, -2: False, -12: False], where only values above 15 are incidents. If you optionally apply an end condition of $feature["values"] < 0, the results would be: [0: False, 10: False, 15: False, 20: True, 40: True, 10: True, 12: True, -2: False, -12: False]. In this example, the incident starts when the start condition is met, and then each sequential feature is an incident until the end condition is true. These examples are outlined in the table below:

    Position:123456789

    Values

    0

    10

    15

    20

    40

    10

    12

    -2

    -12

    Start: $feature["values"] > 15 and no End

    False

    False

    False

    True

    True

    True

    False

    False

    False

    Start: $feature["values"] > 15 and End: $feature["values"] < 0

    False

    False

    False

    True

    True

    True

    True

    False

    False

  • Condition are created using Arcade expressions and can be track aware.

    Learn more about GeoAnalytics Server Arcade expressions with Detect Incidents

  • You can have multiple incidents in a track.

  • Output features will return the fields in the input as well as additional fields:

    • IncidentID—A unique ID given to every feature that is an incident.
    • IncidentStatus—A string field representing the status of an incident. The value will be null if the feature is not an incident, Started, if the feature is the first incident to meet the start condition, OnGoing if the feature is still an incident, and Ended when a feature no longer is an incident. There can be multiple segments of incidents in a single track. For example, a track with these values [0, 10, 15, 20, 40, 10, 12, -2, -12] and a start condition of $feature["values"] > 15 would result in IncidentStatus values of [0: null, 10: null, 15: null, 20: Started, 40: OnGoing, 10: Ended, 12: null, -2: null, -12: null]
    • IncidentDuration—The time, in milliseconds, that an incident occurs. This is calculated as the difference between the feature of interest and the feature that started the incident.
    • Instant_Datetime—The time the feature occurs at.

  • Features are sequentially ordered in time by track. Starting from the first feature, the start condition is evaluated until it is true. Once a feature meets the start condition, the next features are evaluated until the start condition is false (if no end condition is specified) or until the end condition is true (if an end condition is true). Once that condition is met, the incident ends, and the process starts over. There may be multiple incident segments in an individual track. For example, with a track with values [10, 20, 30, 40, 50, 10, 20, 30, 40, 50, 10, 20] and a start condition of $feature["values"] > 20, there would be two segments of incidents [10: null, 20: null, 30: Started, 40: OnGoing, 50: OnGoing, 10: Ended, 20: null, 30: Started, 40: OnGoing, 50: OnGoing, 10: Ended, 20: null].

  • The duration of an incident is calculated in milliseconds as the time of the feature minus the start of an incident. The duration is only calculated if the feature has a status of Started, OnGoing, and Ended. The duration for a feature with the status of Started is always 0.

  • This geoprocessing tool is powered by ArcGIS GeoAnalytics Server. Analysis is completed on your GeoAnalytics Server and results are stored in your content in ArcGIS Enterprise.

  • It is recommended that you use feature layers hosted on your ArcGIS Enterprise portal or use a big data file share data when running GeoAnalytics Tools in ArcGIS Pro. Other data sources may perform slowly when there are more than 1000 features.

    Learn more about sharing data to your portal

    Learn more about creating a big data file share through Server Manager

Syntax

DetectIncidents_geoanalytics (input_layer, output_name, track_fields, start_condition, {end_condition}, {output_mode}, {data_store})
ParameterExplanationData Type
input_layer

Input features that contain potential incidents.

Record Set
output_name

The name of the output feature service.

String
track_fields
[track_fields,...]

One or more fields used to identify unique tracks.

Field
start_condition

The condition used to identify incidents. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields.

Calculator Expression
end_condition
(Optional)

The condition used to end incidents. If no end condition is specified, incidents will end when the start condition is no longer true. Expressions are written in Arcade and can include operators and multiple fields.

Calculator Expression
output_mode
(Optional)

Specifies the features to return, all features or only incidents.

  • ALL_FEATURESAll of the input features are returned. This is the default.
  • INCIDENTSOnly features that were found to be incidents are returned.
String
data_store
(Optional)

Specifies the ArcGIS Data Store where the output will be saved. The default is SPATIOTEMPORAL_DATA_STORE. All results stored to the SPATIOTEMPORAL_DATA_STORE will be stored in WGS84. Results stored in a RELATIONAL_DATA_STORE will maintain their coordinate system.

  • SPATIOTEMPORAL_DATA_STOREOutput will be stored in a spatiotemporal big data store. This is the default.
  • RELATIONAL_DATA_STOREOutput will be stored in a relational data store.
String

Code sample

DetectIncidents example 1 (Python window)

The following Python window script demonstrates how to use the DetectIncidents tool.

#-------------------------------------------------------------------------------
# Name: DetectIncidents.py
# Description: Detect Incidents when wind speed is greater than 100 miles per hour

# Requirements: ArcGIS GeoAnalytics Server

# Import system modules
import arcpy

# Set local variables
inFeatures = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/0"
outFS = "HurricaneTracks_Incidents"
trackIdentifier = "STAGE"
start_condition = "$feature['WINDSPEED'] > 100"

# Execute Reconstruct Tracks
arcpy.geoanalytics.DetectIncidents(inFeatures, outFS, trackIdentifier, calcExpression)

Environments

Output Coordinate System

The coordinate system that will be used for analysis. Analysis will be completed on the input coordinate system unless specified by this parameter. For GeoAnalytics Tools, final results will be stored in the spatiotemporal data store in WGS84.

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS GeoAnalytics Server
  • ArcGIS Desktop Standard: Requires ArcGIS GeoAnalytics Server
  • ArcGIS Desktop Advanced: Requires ArcGIS GeoAnalytics Server

Related topics