What is a center and dispersion analysis?
A center and dispersion analysis is the process of finding center features and directional distribution in feature data. It calculates the central, mean center, median center, or ellipse of features. To execute the analysis, use the spatial analysis service and the Summarize
operation.
Real-world examples of this analysis include the following:
- Finding the directional distribution of pest infestations.
- Selecting the best place to open a library or other point of interest.
- Finding the center of incidents of traffic crashes or crimes.
How to perform a center and dispersion analysis?
The general steps to performing summarize center and dispersion analysis are as follows:
- Review the parameters for the
Summarize
operation.Center And Dispersion - Send a request to get the spatial analysis service URL.
- Execute a job request with the following URL and parameters:
- URL:
http
:// <YOUR _ANALYSIS _SERVICE >/arcgis/rest/services/tasks/ GP Server/ Summarize Center And Dispersion/submit Job - Parameters:
analysis
: The point, line, or polygon features to be analyzed.Layer summarize
: CentralFeature | MeanCenter | MedianCenter | Ellipse.Type output
: A string representing the name of the hosted feature layer to return with the results.Name
- URL:
- Check the status.
- 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
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/SummarizeCenterAndDispersion/submitJob?<parameters>
Required parameters
Name | Description | Examples |
---|---|---|
analysis | The point, line, or polygon features to be analyzed. | {"url" |
token | An OAuth 2.0 access token. | token= |
f | The format of the data returned | f=json f=pjson |
Key parameters
Name | Description | Examples |
---|---|---|
summarize | The method with which to summarize the analysis . | "summarize |
ellipse | The size of the output ellipse in standard deviations. The default ellipse size is 1. Valid choices are 1, 2, or 3 standard deviations. | "ellipseSize": "3 standard deviations" |
weight | A numeric field in the analysis to be used to weight locations according to their relative importance. | |
output | 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). | {"service |
Example
Find the center of beetle infestation
This example uses the Summarize
operation to find the mean and median points, as well as the directional distribution, of a douglas fir beetle infestation between the years 2020-2022.
The analysis
value is the Pest infestation hosted feature layer that is filtered by the type of beetle and the year. The summarize
parameter is set to find the Central
, Mean
, Median
, and Ellipse
. The analysis is weighted by the number of trees (NUM
).
APIs
analysisLayer = {
"url": "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/PST_IF_PT_point/FeatureServer/0",
"filter": "(PST_CMN_NM = 'Douglas-fir Beetle') AND (CPTR_YR >= 2020)",
}
results = summarize_center_and_dispersion(
analysis_layer=analysisLayer,
summarize_type=["CentralFeature", "MeanCenter", "MedianCenter", "Ellipse"],
weight_field="NUM_TREES",
ellipse_size="1 standard deviation",
output_name="Summarize dispersion results", #Outputs results as a hosted feature layer.
context={
"overwrite": True,
"extent": {
"xmin": -15034729.266472297,
"ymin": 5716733.479048933,
"xmax": -12070195.56146081,
"ymax": 7808050.572930799,
"spatialReference": {"wkid": 102100, "latestWkid": 3857},
},
},
)
result_features = results["ellipse_result_layer"].query()
print(
f"summarize result layer contains {len(result_features.features)} records"
)
Service requests
Request
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
{
"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"
}
}
}