Find outliers

An outlier analysis resulting in a new layer with statistically significant clusters and anomalous population values by USA county.

What is an outlier analysis?

An outlier analysis is the process of identifying both clusters and anomalous values (outliers) in spatial data. It determines whether an attribute value or point count for each feature is significantly different, defined as the resultant z-score and p-value, from its neighbors. To execute the analysis, use the spatial analysis service and the FindOutliers operation.

find outliers

The analysis classifies features as being:

  • High-High: a high value surrounded by other high values
  • High-Low: a high value surrounded by low values
  • Low-High: a low value surrounded by high values
  • Low-Low: a low value surrounded by other low values.

A feature is part of a cluster when it has a similar value to its neighbors. A feature is considered an outlier when it has dissimilar values from its neighbors.

An outlier analysis helps to find spatial trends and patterns in the data that may not be visible at first glance.

Real-world examples of this analysis include the following:

  • Finding outliers (either high or low counts) of traffic crashes or crimes.
  • Determining whether there are outlier (anomalous) spending trends or real estate prices.
  • Finding whether some areas of a country might have a higher population despite being surrounded by lower population numbers.

How to perform an outlier analysis

The general steps to performing an outlier analysis are as follows:

  1. Review the parameters for the FindOutliers operation.
  2. Send a request to get the spatial analysis service URL.
  3. Execute a job request with the following URL and parameters:
    • URL: https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindOutliers/submitJob
    • Parameters:
      • analysisLayer: Your dataset as a hosted feature layer or feature collection.
      • analysisField: A numeric field.
      • shapeType: Fishnet or Hexagon.
      • outputName: A string representing the name of the hosted feature layer to reutrn with the results.
  4. Check the status.
  5. Get the output layer results.

To see examples using ArcGIS API for Python, ArcGIS REST JS, and the ArcGIS REST API, go to Examples below.

URL request

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindOutliers/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
analysisLayerThe point or polygon feature layer.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Average_PDX_home_values/FeatureServer/0"}
analysisFieldUse if the analysis layer contains polygons.counts, rates, averages

Key parameters

NameDescriptionExamples
shapeTypeUse if the analysis layer contains points.hexagon, fishnet
boundingPolygonLayerWhen the analysis layer contains points and no analysisField is specified, you can provide a boundary for the analysis.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"}
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

Examples

Identify outliers in traffic crashes

This example uses the FindOutliers operation to determine where there are statistically significant outliers of Traffic crashes counted within a fishnet grid. The anomalous areas, shown as dark red and dark blue, indicate either significantly high or significantly low instances of crashes compared to neighboring clusters.

In the analysis, the analysisLayer value is the Traffic crashes hosted feature layer. The points in the layer are counted within a fishnet, which was set in the shapeType parameter.

Outlier analysis showing clusters and outliers of traffic crashes.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Expand
Use dark colors for code blocksCopy
                                                                  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  const operationUrl = `${analysisUrl}/FindOutliers/submitJob`;

  const params = {

    analysisLayer: {
      url:
        "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Traffic_Crashes/FeatureServer/0",
    },
    shapeType: "Fishnet",
    outputName: {
      serviceProperties: { name: "Find outliers results" },
    },//Outputs results as a hosted feature layer.

  };

  const jobReq = await Job.submitJob({
    url: operationUrl,
    params: params,
    authentication: auth,
  });

  // listen to the status event to get updates every time the job status is checked.
  jobReq.on(JOB_STATUSES.Status, jobInfo => {
    console.log(jobInfo.status);
  });

  // get all the results, this will start monitoring and trigger events
  const jobResp = await jobReq.getAllResults();

  console.log(jobResp);

Service requests

Request
HTTPHTTPcURL
Use dark colors for code blocksCopy
     
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded

&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocksCopy
           
1
2
3
4
5
6
7
8
9
10
11
{
  "helperServices": {
    // Other parameters
    "analysis": {
      "url": "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
    },
    "geoenrichment": {
      "url": "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
    }
  }
}

Identify home value outliers

This example uses an outlier analysis to determine where there are statistically significant outliers for home values in Portland. The anomalous areas, shown as dark red and dark blue, indicate either significantly high or significantly low home values compared to neighboring clusters.

In the analysis, the analysisLayer value is the Enriched Portland hexagon bins hosted feature layer. The feature layer was created using generated hexagon bins that were enriched using data from the GeoEnrichment service. To analyze home values, you set the analysisField with the AVG_CY attribute.

To learn how to generate hexagon bins, go to generate tessellations.

Outlier analysis showing high and low home values.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Expand
Use dark colors for code blocksCopy
                                                                  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  const operationUrl = `${analysisUrl}/FindOutliers/submitJob`;

  const params = {

    analysisLayer: {
      url:
        "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Enriched_PDX_hex_bin_tessellations/FeatureServer/0",
      filter: "AVGVAL_CY <> 0",
    },
    analysisField: "AVGVAL_CY",
    outputName: {
      serviceProperties: { name: "Find outliers results" },
    }, //Outputs results as a hosted feature layer.

  };

  const jobReq = await Job.submitJob({
    url: operationUrl,
    params: params,
    authentication: auth,
  });

  // listen to the status event to get updates every time the job status is checked.
  jobReq.on(JOB_STATUSES.Status, jobInfo => {
    console.log(jobInfo.status);
  });

  // get all the results, this will start monitoring and trigger events
  const jobResp = await jobReq.getAllResults();

  console.log(jobResp);

Service requests

Request
HTTPHTTPcURL
Use dark colors for code blocksCopy
     
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded

&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocksCopy
           
1
2
3
4
5
6
7
8
9
10
11
{
  "helperServices": {
    // Other parameters
    "analysis": {
      "url": "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
    },
    "geoenrichment": {
      "url": "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
    }
  }
}

Tutorials

Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.

Services

Spatial analysis service

Process spatial datasets to discover relationships and patterns.

API support

Full supportPartial supportNo support
  • 1. Access with geoprocessing task
  • 2. Access via ArcGIS REST JS

Tools

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