Summarize center and dispersion

A center and dispersion analysis resulting in new layers that contain the center, mean, median, and ellipse of beetle infestations.

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 SummarizeCenterAndDispersion operation.

summarize center and dispersion

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:

  1. Review the parameters for the SummarizeCenterAndDispersion operation.
  2. Send a request to get the spatial analysis service URL.
  3. Execute a job request with the following URL and parameters:
    • URL: http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/SummarizeCenterAndDispersion/submitJob
    • Parameters:
      • analysisLayer: The point, line, or polygon features to be analyzed.
      • summarizeType: CentralFeature | MeanCenter | MedianCenter | Ellipse.
      • outputName: A string representing the name of the hosted feature layer to return 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/SummarizeCenterAndDispersion/submitJob?<parameters>

Required parameters

NameDescriptionExamples
analysisLayerThe point, line, or polygon features to be analyzed.{"url": <SERVICE_URL>}
tokenAn OAuth 2.0 access token.token=<ACCESS_TOKEN>
fThe format of the data returnedf=json f=pjson

Key parameters

NameDescriptionExamples
summarizeTypeThe method with which to summarize the analysisLayer."summarizeType": ["CentralFeature","MeanCenter","MedianCenter","Ellipse"]
ellipseSizeThe 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"
weightFieldA numeric field in the analysisLayer to be used to weight locations according to their relative importance.
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>"}}

Example

Find the center of beetle infestation

This example uses the SummarizeCenterAndDispersion 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 analysisLayer value is the Pest infestation hosted feature layer that is filtered by the type of beetle and the year. The summarizeType parameter is set to find the CentralFeature, MeanCenter, MedianCenter, and Ellipse. The analysis is weighted by the number of trees (NUM_TREES).

Summarize center and dispersion revealing statistical characteristics of forest infestation.

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
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"
    }
  }
}

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