- URL:
- https://<geoanalytics-url>/DetectIncidents
- Methods:
GET
- Version Introduced:
- 10.6
Description
The Detect
task works with a time-enabled layer of points, lines, areas, or tables that represent an instant in time. Using sequentially ordered features, called tracks, this tool determines which features are incidents of interest. Incidents are determined by conditions that you specify. First, the tool determines which features belong to a track using one or more fields. Using the time at each feature, the tracks are ordered sequentially and the incident condition is applied. Features that meet the starting incident condition are marked as an incident. You can optionally apply an ending incident condition; when the end condition is true, the feature is no longer an incident. The results will be returned with the original features with new columns representing the incident name and indicate which feature meets the incident condition. You can return all original features, only features that are incidents, or all of the feature within tracks where at least one incident occurred.
For example, suppose you have GPS measurements of hurricanes every 10 minutes. Each GPS measurement records the hurricane's name, location, time of recording, and wind speed. Using these fields, you could create an incident where any measurement with a wind speed great than 209 km/h is an incident titled Catastrophic. By not setting an end condition, the incident would end if the feature no longer meets the start condition (wind speeds slows down to less than 208).
Using another example, suppose you were monitoring concentrations of a chemical in your local water supply using a field called containment
. You know that the recommended levels are less than 0.01 mg/L, and dangerous levels are above 0.03 mg/L. To detect incidents, where a value above 0.03 mg/L is an incident, and remains an incident until contamination levels are back to normal, you create an incident using a start condition of containment
and an end condition of containment
. This will mark any sequence where values exceed 0.03mg/L until they return to a value less than 0.01.
Request parameters
Parameter | Details |
---|---|
| The table, point, line, or polygon features containing potential incidents. Syntax: As described in Feature input, this parameter can be one of the following:
REST examples
|
| The fields used to identify distinct tracks. There can be multiple REST examples
|
| The condition used to identify incidents. If there is no REST examples
|
| The condition used to identify incidents. If there is no REST examples
|
| Determines which features are returned. Two modes are available:
REST examples
|
|
A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, starting on January 1, 1980, tracks will be analyzed one day at a time. The REST examples
|
|
The unit applied to the time boundary. Values: REST examples
|
|
A date that specifies the reference time to align the time boundary to, represented in milliseconds from epoch. The default is January 1, 1970, at 12:00 a.m. (epoch time stamp 0). This option is only available if the REST examples
|
|
The task will create a feature service of the results. You define the name of the service. REST examples
|
|
The
Syntax:
|
|
The response format. The default response format is Values: |
Example usage
Below is a sample request URL for Detect
:
https://webadaptor.domain.com/server/rest/services/System/GeoAnalyticsTools/GPServer/DescribeDataset/submitJob?inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&trackFields=Hurricane Name&startConditionExpression=$feature["wind_speed"] > 111&endConditionExpression=$feature["speed"] > 7820 && $feature["height"] < 500&outputMode=Incidents&timeBoundarySplit=2&timeBoundarySplitUnit=Hours&timeBoundaryReference=946684800000&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}}&f=json
Response
When you submit a request, the service assigns a unique job ID for the transaction.
Syntax:
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial request is submitted, you can use job
to periodically check the status of the job and messages as described in Check job status. Once the job has successfully completed, use job
to retrieve the results. To track the status, you can make a request of the following form:
https://<analysis url>/DetectIncidents/jobs/<jobId>
Access results
When the status of the job request is esri
, you can access the results of the analysis by making a request of the following form:
https://<analysis-url>/DetectIncidents/jobs/<jobId>/results/output?token=<your token>&f=json
Response | Description |
---|---|
| The
The result has properties for parameter name, data type, and value. The contents of
See Feature output for more information about how the result layer is accessed. |