Find point clusters

A point cluster analysis resulting in a new layer with areas (clusters) of invasive beetles in Canada.

What is a cluster analysis?

A cluster analysis is the process of finding clusters of point features within surrounding noise at a specified distance. To execute the analysis, use the spatial analysis service and the FindPointClusters operation.

find point clusters

Real-world examples of this analysis include the following:

  • Where are there clusters of traffic incidents?
  • Where are there clusters of instect infestations?
  • Where are there clusters of trees?

How to perform a point cluster analysis

  1. Review the parameters for the FindPointClusters 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/FindPointClusters/submitJob
    • Parameters:
      • analysisLayer: Your dataset as a hosted feature layer or feature collection.
      • minFeaturesCluster: Define how many points constitute a cluster.
      • 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/FindPointClusters/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 data.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Traffic_Crashes/FeatureServer/0"}
minFeaturesClusterDefine the minimum number of features to be considered a cluster.5

Key parameters

NameDescriptionExamples
searchDistanceA double value to use as the maximum distance to search for neighboring features.200
searchDistanceUnitMust be provided if searchDistance is specified.Miles, Feet, Meters, Kilometers
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:"}

Example

Find clusters of traffic crashes

This example uses the FindPointClusters operation to find where there are areas (clusters) of traffic crashes. The analysisLayer value is the Traffic crashes hosted feature layer. The minFeaturesCluster is defined as 500. The results show four distinct colors that represent the four distinct clusters found in the analysis.

Point cluster analysis showing clusters of traffic crashes in San Francisco.

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
  const operationUrl = `${analysisUrl}/FindPointClusters/submitJob`;

  const params = {
    analysisLayer: {
      url:
        "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Traffic_Crashes/FeatureServer/0",
    },
    minFeaturesCluster: 500,
    outputName: {
      serviceProperties: { name: "Find point clusters 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.