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
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:
- Review the parameters for the
Calculateoperation.Composite Index - Send a request to get the spatial analysis service URL.
- Execute a job request with the following URL and parameters:
- URL:
https:// <YOUR _ANALYSIS _SERVICE >/arcgis/rest/services/tasks/ GP Server/ Calculate Composite Index/submit Job - Parameters:
input: The features containing the variables that will be combined into the index.Layer input: The fields that will be combined to create the index.Variables 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/CalculateCompositeIndex/submitJob?<parameters>Required parameters
| Name | Description | Examples |
|---|---|---|
f | The format of the data returned. | f=json f=pjson |
token |
An access token | token= |
input | The input features containing the variables that will be combined into the index | {"url" {"layer |
input | The 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
| Name | Description | Examples |
|---|---|---|
index | The methods that will be used to scale the inputVariables parameter. | "meanScaled" | "meanPercentile" | "meanRow" | "geomeanScaled" | "geomeanPercentile" | "geomeanRow" | "sumFlags" | "Percentile" |
output | A Boolean value that specifies whether the output index should be reversed. | "outputIndexReverse": true |
Examples
Calculate influenza risk
In this example, the Calculate 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.
APIs
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
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"
}
}
}