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.
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
Review the parameters for the FindPointClusters operation.
Send a request to get the spatial analysis service URL.
Execute a job request with the following URL and parameters:
Define the minimum number of features to be considered a cluster.
5
Key parameters
Name
Description
Examples
searchDistance
A double value to use as the maximum distance to search for neighboring features.
200
searchDistanceUnit
Must be provided if searchDistance is specified.
Miles, Feet, Meters, Kilometers
outputName
A 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>"}}
context
A 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 API for PythonArcGIS API for PythonArcGIS REST JS
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
analysisLayer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Traffic_Crashes/FeatureServer/0"results = find_point_clusters(
analysis_layer=analysisLayer,
min_features_cluster=500,
#Ouputs results as a hosted feature service. output_name="Find point clusters results",
)
result_features = results.layers[0].query()
print(
f"The find point clusters layer has {len(result_features.features)} new records")
Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.