A composite index analysis resulting in a new layer with the calculated index of influenza risk.

What is a composite index analysis

A composite index analysis combines multiple variables into a single score by standardizing, weighting, and classifying the result for decision-making. It uses numeric fields from feature data, and returns a new feature service as an asynchronous job. Use the spatial analysis service and the CalculateCompositeIndex operation to run it.

composite index feature analysis

Real-world examples of this analysis include the following:

  • Map heat vulnerability to prioritize cooling and greening investments.
  • Rank watershed stress to target restoration efforts.
  • Identify transit equity gaps to guide service improvements.
  • Prioritize flood-risk areas for mitigation and infrastructure funding.

To learn more, go to the Creating Composite Indices technical paper.

How a composite index analysis works

The general steps to performing a composite index analysis are as follows:

  1. Review the parameters for the CalculateCompositeIndex 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/CalculateCompositeIndex/submitJob
    • Parameters:
      • inputLayer: The features containing the variables that will be combined into the index.
      • inputVariables: The fields that will be combined to create the index.
      • 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/CalculateCompositeIndex/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
token An access token from user authentication, API key, or app authentication. The access token requires account impersonation. To learn more see Security and authentication guide > Privileges.token=<ACCESS_TOKEN>
inputLayerThe input features containing the variables that will be combined into the index{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}
inputVariablesThe fields that will be combined to create the index."inputVariables": [ {"field":"<FIELD_NAME_1>","reverseVariable":true,"weight":2}, {"field":"<FIELD_NAME_2>","reverseVariable":false,"weight":1}, {"field":"<FIELD_NAME_3>","reverseVariable":false,"weight":1} ]

Key parameters

NameDescriptionExamples
indexMethodThe methods that will be used to scale the inputVariables parameter."meanScaled" | "meanPercentile" | "meanRow" | "geomeanScaled" | "geomeanPercentile" | "geomeanRow" | "sumFlags" | "Percentile"
outputIndexReverseA Boolean value that specifies whether the output index should be reversed."outputIndexReverse": true

Examples

Calculate influenza risk

In this example, the CalculateCompositeIndex is used to combine multiple variables into a single score for influenza risk.

In this analysis, the following variables are used to calculate influenza risk:

  • The percentage of the population that is over 65 years old, which is a high-risk group for influenza.
  • The percentage of the population that reports being in poor or fair health, which can increase susceptibility to influenza.
  • The percentage of the population that has received the influenza vaccine, which can reduce the risk of infection.
A composite index analysis resulting in a new layer with the calculated index of influenza risk.

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
input_layer_url = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Minnesota_county_health_rankings/FeatureServer/0"

results = calculate_composite_index(
    input_layer=input_layer_url,
    input_variables=[
        {"reverseVariable":False,"weight":1,"field":"v053_rawvalue"},
        {"reverseVariable":False,"weight":1,"field":"v002_rawvalue"},
        {"reverseVariable":True,"weight":1,"field":"v155_rawvalue"}
    ],
    index_method="meanScaled",
    output_index_reverse=False,
    # Outputs results as a hosted feature layer.
    output_name="Calculate composite index python results",
)

result_features = results.layers[0].query()

print(f"The index result layer has {len(result_features.features)} new 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
{
  "helperServices": {
    // Other parameters...
    "analysis": {
      "url": "https://{YOUR_ANALYSIS_SERVICE}/arcgis/rest/services/tasks/GPServer"
    }
  }
}

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