Skip To Content

Aggregate Multidimensional Raster

Available with Image Analyst license.

Description

Aggregate Multidimensional Raster diagram

The AggregateMultidimensionalRaster task can be used to generate a .CRF multidimensional raster dataset and image service by aggregating existing multidimensional dataset variables along a dimension.

License:
As of 10.8, you must license your ArcGIS Server as an ArcGIS Image Server to use this resource.

Request parameters

ParameterDetails
inputMultidimensionalRaster

(Required)

The Portal Item ID, Image Service URL, cloud multidimensional raster dataset, or shared multidimensional raster dataset.

Syntax: A JSON object describes the input multidimensional raster. At least one type of input must be provided in the JSON object. If multiple inputs are given, the itemid takes priority.


inputMultidimensionalRaster={"itemId": <portal item id>}
inputMultidimensionalRaster={“url”: <image service url>}
inputMultidimensionalRaster={“uri”: <cloud raster uri or shared data path>}

outputName

(Required)

Output hosted image service properties. If the hosted image service is already created, the portal item ID or service URL can be given to the service tool. The output path of the multidimensional raster dataset generated in the raster store will be used to update the existing service definition. The service tool can also generate a new hosted image service with the given service properties.

The output hosted image service is stored in a raster store and shared on either the raster analysis image server or image hosting image server depending on the enterprise configuration.

Syntax: A JSON object describes the output multidimensional raster. At least one type of input must be provided in the JSON object. If multiple inputs are given, the itemId takes priority.

Note:

Set image,metadata as image service capabilities to ensure the output image service can be recognized as multidimensional by other raster analysis tools.

Example:


outputName={"itemId": <portal item id>}
outputName={“url”: <image service url>}
outputName={“uri”: <cloud raster uri or shared data path>}
or
outputName={"serviceProperties": {“name”: ”aggregated_watertemp_salinity”, ”capabilities”: ”image, metadata”}}

dimension

(Required)

The aggregation dimension. This is the dimension along which the variables will be aggregated.

Syntax: A string representing the dimension name.

Example:


dimension=StdTime

aggregationMethod

(Optional)

Specifies the mathematical method that will be used to combine the aggregated slices in an interval.

  • MEAN—Calculates the mean of a pixel's values across all slices in the interval. This is the default.
  • MAXIMUM—Calculates the maximum value of a pixel across all slices in the interval.
  • MAJORITY—Calculates the value that occurred most frequently for a pixel across all slices in the interval.
  • MINIMUM—Calculates the minimum value of a pixel across all slices in the interval.
  • MINORITY—Calculates the value that occurred least frequently for a pixel across all slices in the interval.
  • MEDIAN—Calculates the median value of a pixel across all slices in the interval.
  • PERCENTILE—Calculates the percentile of values for a pixel across all slices in the interval. The 90th percentile is calculated by default. You can specify other values (from 0 to 100) using the percentileValue parameter.
  • RANGE—Calculates the range of values for a pixel across all slices in the interval.
  • STD—Calculates the standard deviation of a pixel's values across all slices in the interval.
  • SUM—Calculates the sum of a pixel's values across all slices in the interval.
  • VARIETY—Calculates the number of unique values of a pixel across all slices in the interval.
  • CUSTOM—Calculates the value of a pixel based on a custom raster function.

When the aggregationMethod is set to CUSTOM, the aggregationFunction parameter must be specified.

Syntax: A string representing the aggregation method.

Example:


aggregationMethod=MEAN

variables

(Optional)

The variable or variables that will be aggregated along the given dimension. If no variable is specified, all variables with the selected dimension will be aggregated.

For example, to aggregate your daily temperature data into monthly average values, specify temperature as the variable to be aggregated. If you do not specify any variables and you have both daily temperature and daily precipitation variables, both variables will be aggregated into monthly averages and the output multidimensional raster will include both variables.

Syntax: A string containing the variables. Multiple variables are separated by commas.

Example:


variables=["cceiling"]

Or

variables=["cceiling","ccover"]

aggregationDefinition

(Optional)

Specifies the dimension interval for which the data will be aggregated.

  • ALL—The data values will be aggregated across all slices. This is the default.
  • INTERVAL_KEYWORD—The variable data will be aggregated using a commonly known interval.
  • INTERVAL_VALUE—The variable data will be aggregated using a user-specified interval and unit.
  • INTERVAL_RANGES—The variable data will be aggregated between specified pairs of values or dates.

Syntax: A string of one of the keywords.

Example:


aggregationDefinition=ALL

intervalKeyword

(Optional; required when aggregateDefinition is INTERVAL_KEYWORD)

Specifies the keyword interval that will be used when aggregating along the dimension. This parameter is required when the aggregationDefinition parameter is set to INTERVAL_KEYWORD, and the aggregation must be across time.

  • HOURLY—The data values will be aggregated into hourly time steps.
  • DAILY—The data values will be aggregated into daily time steps, and the result will include every day in the time series.
  • WEEKLY—The data values will be aggregated into weekly time steps.
  • MONTHLY—The data values will be aggregated into monthly time steps.
  • QUARTERLY—The data values will be aggregated into quarterly time steps.
  • YEARLY—The data values will be aggregated into yearly time steps.
  • RECURRING_DAILY—The data values will be aggregated into daily time steps, and the result includes one aggregated value per day. The output will include, at most, 366 daily time slices.
  • RECURRING_WEEKLY—The data values will be aggregated into weekly time steps, and the result will include one aggregated value per week. The output will include, at most, 53 weekly time slices.
  • RECURRING_MONTHLY—The data values will be aggregated into weekly time steps, and the result will include one aggregated value per month. The output will include, at most, 12 monthly time slices.
  • RECURRING_QUARTERLY—The data values will be aggregated into weekly time steps, and the result will include one aggregated value per quarter. The output will include, at most, four quarterly time slices.
  • DEKADLY—Divides each month into three periods of 10 days each (last period may have more than or less than 10 days) and each month will output three slices.
  • PENTADLY—Divides each month into six periods of 5 days each (last period may have more than or less than 5 days) and each month will output six slices.

Syntax: A string of one of the keywords.

Example:


intervalKeyword=HOURLY

intervalValue

(Optional; required when aggregateDefinition is INTERVAL_VALUE)

The size of the interval that will be used for the aggregation. For example, to aggregate 30 years of monthly temperature data into 5-year increments, type 5 as the intervalValue, and specify intervalUnit as YEARS.

Syntax: A string representing the internal value.

Example:


intervalValue=5

intervalUnit

(Optional; required when aggregateDefinition is INTERVAL_VALUE)

The unit that will be used for the interval value. This parameter is required when the dimension parameter is set to a time field. If you are aggregating over anything other than time, leave this parameter empty and the unit for the interval value will match the variable unit of the input multidimensional raster data.

  • HOURS—The data values will be aggregated into hourly time slices at the interval provided.
  • DAYS—The data values will be aggregated into daily time slices at the interval provided.
  • WEEKS—The data values will be aggregated into weekly time slices at the interval provided.
  • MONTHS—The data values will be aggregated into monthly time slices at the interval provided.
  • YEARS—The data values will be aggregated into yearly time slices at the interval provided.

Syntax: A string of one of the keywords.

Example:


intervalUnit=HOURS

intervalRanges

(Optional; required when aggregateDefinition is INTERVAL_VALUE)

Interval ranges will be used to aggregate groups of values. The string consists of pairs of minimum and maximum range values.

Note:

The time dimension values must be in standard date format.

Syntax: Two types of syntax are supported:

  • String representing one or multiple pairs of minimum and maximum range values; ranges are separated by semicolon.
  • List of dictionaries.

Example of one time interval range:


intervalRanges=2013-03-15T00:00:00 2013-03-15:09:00:00

Or

intervalRanges=[{"minValue":"2013-03-15T00:00:00","maxValue":"2013-03-15T09:00:00"}]

Example of multiple time interval ranges:


intervalRanges=2013-03-15T00:00:00 2013-03-15:09:00:00

Or

intervalRanges=[{"minValue":"2013-03-15T00:00:00","maxValue":"2013-03-15T09:00:00"},{"minValue":"2013-03-15T09:00:00","maxValue":"2013-03-15T18:00:00"}]

aggregationFunction

(Optional; required when aggregationMethod is CUSTOM)

A custom raster function that will be used to compute the pixel values of the aggregated rasters. It can be created from a function chain or a custom Python raster function.

The input is the entire JSON string of a raster function template, an .rft.xml file, an .rft.json file, or a raster function template item on a portal.

Example of a portal item:

aggregationFunction={“itemId”: “6bfebb6b12ac4eb69ac44a45feca26b8”}

Example of an XML or JSON file:


aggregationFunction=\\sharedstorage\sharefolder\customArgStats.rft.xml

Or

aggregationFunction=\\sharedstorage\sharefolder\customArgStats.rft.json

Example of a JSON string:


aggregationFunction={
  "name": "ArgStatistics",
  "description": "Computes arg statistics including Arg Max, Arg Min, Arg Median, and Duration.",
  "function": {
    "pixelType": "UNKNOWN",
    "name": "ArgStatistics",
    "description": "Computes arg statistics including Arg Max, Arg Min, Arg Median, and Duration.",
    "type": "ArgStatisticsFunction",
    "_object_id": 1
  },
  "arguments": {
    "Rasters": {
      "name": "Rasters",
      "value": {
        "elements": [],
        "type": "ArgumentArray",
        "_object_id": 2
      },
      "aliases": [
        "__IsRasterArray__"
      ],
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 3
    },
    "ArgStatisticsType": {
      "name": "ArgStatisticsType",
      "value": 0,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 4
    },
    "UndefinedClass": {
      "name": "UndefinedClass",
      "value": 100,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 5
    },
    "MinValue": {
      "name": "MinValue",
      "value": 1,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 6
    },
    "MaxValue": {
      "name": "MaxValue",
      "value": 1,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 7
    },
    "MatchVariable": {
      "name": "MatchVariable",
      "value": true,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 8
    },
    "UnionDimension": {
      "name": "UnionDimension",
      "value": false,
      "isDataset": false,
      "isPublic": false,
      "type": "RasterFunctionVariable",
      "_object_id": 9
    },
    "type": "ArgStatisticsFunctionArguments",
    "_object_id": 10
  },
  "functionType": 0,
  "thumbnail": ""
}

ignoreNoData

(Optional)

Specifies whether NoData values are ignored in the analysis.

  • true—The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.
  • false—The analysis will result in NoData if there are any NoData values for the pixel along the given dimension.

Values: true | false

dimensionless

Specifies whether the layer will have dimension values. This parameter is only active if a single slice is selected to create a layer.

  • true—The layer will not have dimension values.
  • false—The layer will have dimension values. This is the default.

Syntax: A Boolean value as either true or false.

Example

dimensionless=true
percentileValue

The percentile to calculate. The default is 90, indicating the 90th percentile.

The values can range from 0 to 100. The 0th percentile is essentially equivalent to the minimum statistic, and the 100th percentile is equivalent to maximum. A value of 50 will produce essentially the same result as the median statistic.

This option is enabled only if the aggregationMethod parameter is set to PERCENTILE.

Syntax: A double value that represents the percentileValue.

percentileValue=90
percentileInterpolationType

Specifies the method of percentile interpolation that will be used when there is an even number of values from the input raster to be calculated.

  • NEAREST—The nearest available value to the desired percentile will be used. In this case, the output pixel type will be the same as that of the input value raster. This is the default.
  • LINEAR—The weighted average of the two surrounding values from the desired percentile will be used. In this case, the output pixel type will be floating point.

Syntax: A string value that represents the percentileInterpolationType.

Example

percentileInterpolationType=NEAREST
context

(Optional)

Contains additional settings that affect task execution. This task has the following settings:

  • Cell Size (cellSize)—The output raster will have the resolution specified by cell size.
  • Extent (extent)—A bounding box that defines the analysis area.
  • Output Spatial Reference (outSR)—The output raster will be projected into the output spatial reference.
  • Parallel Processing Factor (parallelProcessingFactor)—The specified number or percentage of processes will be used for the analysis.
  • Resampling Method (resamplingMethod)—Specifies the resampling method that will be used when creating the raster dataset for download.
    • NEAREST—The value of the closest cell will be used to assign a value to the output cell when resampling. This is the default.
    • BILINEAR—The new value of a cell will be based on a weighted distance average of the four nearest input cell centers.
    • CUBIC—The new value of a cell will be based on fitting a smooth curve through the 16 nearest input cell centers.
  • Snap Raster (snapRaster)—The output raster will have its cells aligned with the specified snap raster.

Example:

context={"cellSize": "20", "parallelProcessingFactor": "4"}

f

The response format. The default response format is html.

Values: html | json

Response

When you submit a request, the task 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 the jobId to periodically check the status of the job and messages, as described in Check job status. Once the job has successfully completed, use the jobId to retrieve the results. To track the status, you can make a request of the following form:

https://<analysis-url>/AggregateMultidimensionalRaster/jobs/<jobId>

Accessing results

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

https://<rasteranalysis-url>/AggregateMultidimensionalRaster/jobs/<jobId>/results/outputMultidimensionalRaster?token=<your token>&f=json

ParameterDescription
outputMultidimensionalRaster

The output multidimensional raster itemId and URL.

Example:

{"url": "https://rasteranalysis-url>/ AggregateMultidimensionalRaster/jobs/<jobId>/results/outputMultidimensionalRaster"}

The result has properties for parameter name, data type, and value. The content of the value is always the output raster dataset's itemId and image service URL.


{
  "paramName": " outputMultidimensionalRaster",
   "dataType": "GPString",
   "value": {
     "itemId": "c267610d0feb4370bf38cc6e2c4ac261",
     "url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
   }
}

Related topics