Detect Incidents (GeoAnalytics Desktop)

Summary

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

Illustration

Detect Incidents tool illustration

Usage

  • The following table outlines terminology for the Detect Incidents tool:

    TermDescription

    Track

    A sequence of features that are time enabled with time type instant. Features are determined to be in the sequence by a track identifier field and are ordered by time. For example, a city could have a fleet of snowplow trucks that record their location every 10 minutes. The vehicle ID could represent the distinct tracks.

    Incident

    Features that meet a condition of interest.

    Instant

    A single moment in time represented by a start time and no end time. Inputs to Detect Incidents must have a time type of instant.

    Interval

    A duration of time represented by a start and an end time.

    Feature of interest

    Describes the feature being analyzed. During analysis, all features are analyzed.

  • Incidents are features that meet a specified condition.

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

  • Detect Incidents can be completed on point, line, or polygon 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 track fields. For example, if the fields flightID and Destination are used as track identifiers, the [ID007, Solden] and [ID007, Tokyo] features would be in two separate tracks, because they have different values for the Destination field.

  • Conditions 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 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 each sequential feature is an incident until the end condition is true. These examples are outlined in the following table:

    Position123456789

    Value

    0

    10

    15

    20

    40

    10

    12

    -2

    -12

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

    False

    False

    False

    True

    True

    False

    False

    False

    False

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

    False

    False

    False

    True

    True

    True

    True

    False

    False

    Applying a time interval segments tracks at a defined interval. For example, if you set the time interval boundary to be 1 day, starting at 9:00 a.m. on January 1, 1990, each track will be truncated at 9:00 a.m every day. This split accelerates computing time, as it creates smaller tracks for analysis. If splitting by a recurring time interval boundary makes sense for your analysis, it is recommended for big data processing.

  • Conditions are created using Arcade expressions and can be track aware. See Arcade Expressions in GeoAnalytics Desktop tools for more information.

  • A track can have multiple incidents.

  • Output features will return the fields in the input as well as the following 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 is no longer an incident. A single track can have multiple segments of incidents. For example, a track with values [0, 10, 15, 20, 40, 10, 12, -2, -12] and a start condition of $feature["values"] > 15 will 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, 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.

  • 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 specified). Once that condition is met, the incident ends, and the process starts again. There may be multiple incident segments in an individual track. For example, for 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, or Ended. The duration for a feature with the status of Started is always 0.

  • You can improve performance of the Detect Incidents tool by doing one or more of the following:

    • Set the extent environment so that you only analyze data of interest.
    • Only output the incident features.
    • Split your tracks using the Time Boundary Split parameter.
    • Use data that is local to where the analysis is being run.

  • This geoprocessing tool is powered by Spark. Analysis is completed on your desktop machine using multiple cores in parallel. See Considerations for GeoAnalytics Desktop tools to learn more about running analysis.

  • When running GeoAnalytics Desktop tools, the analysis is completed on your desktop machine. For optimal performance, data should be available on your desktop. If you are using a hosted feature layer, it is recommended that you use ArcGIS GeoAnalytics Server. If your data isn't local, it will take longer to run a tool. To use your ArcGIS GeoAnalytics Server to perform analysis, see GeoAnalytics Tools.

Parameters

LabelExplanationData Type
Input Layer

The input features that contain potential incidents.

Table View
Output Dataset

A new output dataset that contains incidents.

Feature Class;Table
Track Fields

A field or fields that will be used to identify unique tracks.

Field
Start Condition

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

If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.

Learn more about expressions in Detect Incidents

Calculator Expression
End Condition
(Optional)

The condition that will be 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.

If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.

Calculator Expression
Output Mode
(Optional)

Specifies the features that will be returned.

  • All featuresAll the input features will be returned. This is the default.
  • IncidentsOnly features that were found to be incidents will be returned.
String
Time Boundary Split
(Optional)

A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.

Time Unit
Time Boundary Reference
(Optional)

The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.

Date

arcpy.geoanalytics.DetectIncidents(input_layer, output, track_fields, start_condition, {end_condition}, {output_mode}, {time_boundary_split}, {time_boundary_reference})
NameExplanationData Type
input_layer

The input features that contain potential incidents.

Table View
output

A new output dataset that contains incidents.

Feature Class;Table
track_fields
[track_fields,...]

A field or fields that will be used to identify unique tracks.

Field
start_condition

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

Calculator Expression
end_condition
(Optional)

The condition that will be used to end incidents. If no end condition is specified, incidents will end when the start condition is no longer true.

Calculator Expression
output_mode
(Optional)

Specifies the features that will be returned.

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

A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.

Time Unit
time_boundary_reference
(Optional)

The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.

Date

Code sample

DetectIncidents example (stand-alone script)

The following stand-alone script demonstrates how to use the DetectIncidents function.

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

# Import system modules
import arcpy

arcpy.env.workspace = "C:/data/Weather.gdb"

# Enable time on the input features using an .lyrx file.
# To create the .lyrx file, add your layer to a map, open the layer properties 
# and enable time. Then right-click the layer and select Share As Layer File.
inputLyrx = r'C:\data\Hurricanes.lyrx'

# MakeFeatureLayer converts the .lyrx to features
hurricanesLayer = arcpy.management.MakeFeatureLayer(inputLyrx, "Hurricanes Layer")

# ApplySymbologyFromLayer sets the time using the .lyrx file definition
arcpy.management.ApplySymbologyFromLayer(hurricanesLayer, inputLyrx)

# Set local variables
out = "Hurricane_Incidents"
trackIdentifier = "STAGE"
startCondition = "$feature['WINDSPEED'] > 100"

# Run Detect Incidents
arcpy.gapro.DetectIncidents(hurricanesLayer, out, trackIdentifier, startCondition)