Skip To Content
ArcGIS Developer
Dashboard

Calculate Composite Index

The CalculateCompositeIndex task combines multiple numeric variables to create a single index. This task is only available in ArcGIS Online.

Learn more about how Calculate Composite Index works

Request URL

http://<analysis url>/CalculateCompositeIndex/submitJob

Request parameters

ParameterDescription

inputLayer

(Required)

The input table or features containing the variables that will be combined into the index.

Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:

  • A URL to a feature service layer with an optional filter to select specific features
  • A feature collection

Examples:

  • {"url": <feature service layer url>, "filter": <where clause>}
  • {"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

inputVariables

(Required)

The variables that will be combined to create the index. Provide at least two variables. For each variable, specify the following:

  • field—The numeric field from the inputLayer containing the variable. Any records in the field with missing values will not be included in the analysis.
  • reverseVariable—Specifies whether the values of the variable will be reversed. If no value is specified, the value will be set to false. When true, the feature or record that originally had the highest value will have the lowest value, and vice versa. Values will be reversed after scaling. To create an index, variables must be on a compatible scale; reversing some variables may be required to ensure that the meaning of low and high values in each variable is consistent.
  • weight—The relative influence of the variable on the index. If each variable should have equal contribution, set the value to 1. Increase or decrease the weight to reflect the relative importance of the variable. For example, if a variable is twice as important as the others, use a weight of 2.

Example: "inputVariables":[{"field":"median_income", "reverseVariable": true, "weight": 2}, {"field": "pct_uninsured", "reverseVariable": false, "weight": 1}, {"field": "pct_unemployed", "reverseVariable": false, "weight": 1}]

indexMethod

The methods that will be used to scale the inputVariables parameter and combine the scaled variables to create the index.

Scaling is a type of preprocessing that ensures that the variables are on a compatible scale before they are combined. The scaled variables are then combined to create a single index value. The following options are available:

  • meanScaled—Creates the index by scaling the input variables between 0 and 1 (minimum-maximum scaling) and calculating the mean of the scaled values. This method is useful for creating an index that is easy to interpret. The shape of the distribution and outliers in the input variables will impact the index.
  • meanPercentile—Creates the index by scaling the ranks of the input variables between 0 and 1 (scaling by percentile) and calculating the mean of the scaled ranks. This option is useful when the rankings of the variable values are more important than the differences between values. The shape of the distribution and outliers in the input variables will not impact the index.
  • meanRaw—Creates the index by calculating the mean of the raw input variables. This option is useful when variables are already on a compatible scale.
  • geomeanScaled—Creates the index by scaling the input variables between 0 and 1 (minimum-maximum scaling) and calculating the geometric mean of the scaled values. High values will not cancel low values, so this option is useful for creating an index in which higher index values will occur only when there are high values in multiple variables.
  • geomeanPercentile—Creates the index by scaling the ranks of the input variables between 0 and 1 (scaling by percentile) and calculating the geometric mean of the scaled ranks. This option is useful when the rankings of the variable values are more important than the differences between values and when high variable values should not cancel out low variable values.
  • geomeanRaw—Creates the index by calculating the geometric mean of the raw input variables. This option is useful when variables are already on a compatible scale and when high variable values should not cancel out low variable values.
  • sumFlagsPercentile—Creates the index by counting the number of input variables with values greater than or equal to the 90th percentile. This method is useful for identifying locations that may be considered the most extreme or the most in need.

Values: meanScaled | meanPercentile | meanRaw | geomeanScaled | geomeanPercentile | geomeanRaw | sumFlagsPercentile

Default: meanScaled

Example: "indexMethod": "meanPercentile"

outputIndexReverse

Specifies whether the output index values will be reversed in direction. When true, high index values will be treated as low index values and vice versa. Reversing is applied after combining the scaled variables.

Values: true | false

Default: false

Example: "outputIndexReverse": true

outputIndexMinMax

The minimum and maximum of the output index values. Specifying a minimum and maximum value will apply minimum-maximum scaling to the combined variables.

Example: "outputIndexMinMax": "[{'min': 0, 'max': 100}]"

outputName

If provided, the task will create a feature service of the results. You define the name of the service. If no outputName value is provided, the task will return a feature collection.

Syntax:

{
  "serviceProperties": {
    "name": "<service name>"
  }
}
You can overwrite an existing feature service by providing the itemId value of the existing feature service and setting the overwrite property to true. Including the serviceProperties parameter is optional. As described in the Feature output topic, you must either be the owner of the feature service or have administrative privileges to perform the overwrite.

Syntax:

{

  "itemProperties": {
			"itemId": "<itemID of the existing feature service>",
			"overwrite": true
	}
}
or
{
"serviceProperties": {
    "name": "<existing service name>"
  },
"itemProperties": {
				"itemId": "<itemID of the existing feature service>",
				"overwrite": true
	}
}

context

The Context parameter contains the following additional settings that affect task operation:

  • Extent (extent)—A bounding box that defines the analysis area. Only input features that intersect the bounding box will be analyzed.
  • Output spatial reference (outSR)—The output features will be projected into the output spatial reference.

Syntax:

{
"extent" : {extent},
"outSR" : {spatial reference}
}

f

The response format. The default response format is html.

Values: html | json

Response

When you submit a request, the service assigns a unique job ID for the transaction.

Syntax:

{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}

After the initial request is submitted, you can use jobId to periodically check the status of the job and messages as described in the Checking job status topic. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:

http://<analysis url>/CalculateCompositeIndex/jobs/<jobId>

Access results

When the status of the job request is esriJobSucceded, you can access the results of the analysis by making a request of the following form:

http://analysis.arcgis.com/arcgis/rest/services/tasks/gpserver/CalculateCompositeIndex/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json

ParameterDescription

indexResultLayer

The result of CalculateCompositeIndex is a layer containing the index results. The layer includes the fields containing the input variables after preprocessing (reversing and scaling), the raw index prior to reversing and minimum-maximum scaling, the index value, the index rank, and the index percentile. It also includes fields with the index value reclassified into quantile classes, equal interval classes, and standard deviation classes.

Example:

{"url": "http://analysis.arcgis.com/arcgis/rest/services/tasks/gpserver/CalculateCompositeIndex/jobs/<jobId>/results/indexResultLayer"}

The result has properties for parameter name, data type, and value. The contents of value depends on the OutputName value provided in the initial request.

  • If theOutputName value was provided, value contains the URL to the feature service layer.

    {
    "paramName":"indexResultLayer", 
    "dataType":"GPRecordSet",
    "value":{"url":"<arcgis featureservice layer url>"}
    }

  • If noOutputName value was provided, value contains a feature collection.

    {
    "paramName":"indexResultLayer",
    "dataType":"GPRecordSet",
    "value":{"featureCollection": ... }
    }

See Feature Output for more information about how the result layer or collection is accessed.