Generate Trend Raster

URL:
https://<rasteranalysistools-url>/GenerateTrendRaster
Methods:
GET
Version Introduced:
10.8

Description

Generate Trend Raster

The GenerateTrendRaster task allows you estimate the trend for each pixel along a dimension for one or more variables in a multidimensional raster.

Request parameters

ParameterDetails

inputMultidimensionalRaster

(Required)

The portal folder ID, portal item ID, image service URL, cloud raster dataset, or shared raster dataset that will be added to the image collection. At least one type of input must be provided in the JSON object. If multiple inputs are provided, the itemId takes priority.

Syntax: A JSON object describes the input raster.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
//Portal Folder ID
inputMultidimensionalRaster={"folderId": <portal folder id>}

//Portal Item ID
inputMultidimensionalRaster={"itemId": <portal item id>}

//Image Service URL
inputMultidimensionalRaster={"url": <image service url>}

//Cloud Raster URI or Shared Data Path
inputMultidimensionalRaster={"uri": <cloud raster uri or shared data path>}

outputName

(Required)

The output hosted image service properties. If there is an existing hosted image service, you can provide the portal item ID or service URL. 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 service properties provided. The output hosted image service is stored in the raster store and is shared on either the Raster Analysis Image Server or the 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 provided, the itemId takes priority.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
//Portal Item ID
outputName={"itemId": <portal item id>}

//Image Service URL
outputName={"url": <image service url>}

//Cloud Raster URI or Shared Data Path
outputName={"uri": <cloud raster uri or shared data path>}

//Service Properties
outputName={"serviceProperties": {"name": "predicted_water_temp", "capabilities": "image, metadata"}}

dimension

(Required)

The dimension along which a trend will be extracted for the variable or variables selected in the analysis.

Syntax: A string representing the dimension name.

Example

Use dark colors for code blocksCopy
1
dimension="StdTime"

variables

(Optional)

The variable or variables for which trends will be calculated. If no variable is specified, the first variable in the multidimensional raster will be analyzed.

Syntax: Either a string representing the variables, with multiple variables separated by a comma, or a list containing the variables.

Example

Use dark colors for code blocksCopy
1
variables=["ceiling","cover"]

trendLineType

Specifies the type of line to be used to fit to the pixel values along a dimension.

  • LINEAR —The pixel values for a variable will fit along a linear trend line. This is the default.
  • POLYNOMIAL —The pixel values for a variable will fit along a second order polynomial trend line.
  • HARMONIC —The pixel values for a variable will fit along a harmonic trend line.
  • MANN-KENDALL —Variable pixel values will be evaluated using the Mann-Kendall trend test.
  • SEASONAL-KENDALL —Variable pixel values will be evaluated using the Seasonal-Kendall trend test.

Values: LINEAR | POLYNOMIAL | HARMONIC | MANN-KENDALL | SEASONAL-KENDALL

cycleLength

The length of periodic variation to model. This parameter is required when trendLineType is set to HARMONIC . For example, leaf greenness often has one strong cycle of variation in a single year, so the cycle length is 1 year. Hourly temperature data has one strong cycle of variation throughout a single day, so the cycle length is 1 day. The default is null .

Syntax: Double value

Example

Use dark colors for code blocksCopy
1
cycleLength=1

cycleUnit

Specifies either days (DAYS ) or years (YEARS ) as the unit to be used for the length of the harmonic cycle. YEARS is the default value.

Values: DAYS | YEARS

frequency

(Optional)

If the trendLineType parameter is HARMONIC , the default value is 1, or one harmonic cycle per year. If the trendLineType parameter is POLYNOMIAL , the default value is 2, or second order polynomial.

ignoreNoData

(Optional)

Specifies whether NoData values are ignored in the analysis. If true , the analysis will include all valid pixels along the time dimension and ignore any NoData pixels. This is the default. If false , the analysis will result in NoData if there are any NoData values for the pixels along the time dimension.

Values: true | false

RMSE

Specifies whether the root mean square error (RMSE) of the trend fit line will be calculated. If true , the RMSE will be calculated and included as one of the bands of trend raster. This is the default. If false , the RMSE will not be calculated.

Values: true | false

R2

Specifies whether the R-squared goodness-of-fit statistic for the trend fit line will be calculated. If true , the R-squared value will be calculated and included as one of the bands of trend raster. If false , the R-squared value will not be calculated. This is the default.

Values: true | false

slopePValue

Specifies whether the p-value statistic for the slope coefficient of the trend line will be calculated. If true , the p-value will be calculated and included as one of the bands of trend raster. If false , the p-value will not be calculated. This is the default.

Values: true | false

seasonalPeriod

Specifies the time unit to be used for the length of a seasonal period when performing the Seasonal-Kendall test.

  • DAYS —The unit for the length of the seasonal period is days. This is the default.
  • MONTHS —The unit for the length of the seasonal period is months.

Values: DAYS | MONTHS

context

(Optional)

Contains additional settings that affect task execution. This parameter 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.

f

The response format. The default response format is html.

Values: html | json

Example usage

The following is a sample request URL for GenerateTrendRaster :

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/System/RasterAnalysisTools/GPServer/GenerateTrendRaster?inputMultidimensionalRaster={"itemId": "1780d648db3545bba8661ad98df824a4"}&outputName={"serviceProperties": {"name": "temperature_trend"}}&dimension="StdTime"&f=json

The following is a sample POST request for GenerateTrendRaster :

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /webadaptor/rest/services/System/RasterAnalysisTools/GPServer/GenerateTrendRaster HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

inputMultidimensionalRaster={"itemId": "1780d648db3545bba8661ad98df824a4"}&outputName={"serviceProperties": {"name": "temperature_trend"}}&dimension="StdTime"&f=json

Both examples above use the following parameters and values in their requests:

Use dark colors for code blocksCopy
1
2
3
4
inputMultidimensionalRaster={"itemId": "1780d648db3545bba8661ad98df824a4"}&
outputName={"serviceProperties": {“name”:“temperature_trend”}}&
dimension="StdTime"&
f=json

Response

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

Syntax:

Use dark colors for code blocksCopy
1
{ "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:

Use dark colors for code blocksCopy
1
https://<rasterAnalysisTools-url>/GenerateTrendRaster/jobs/<jobId>

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:

Use dark colors for code blocksCopy
1
https://<rasterAnalysisTools-url>/GenerateTrendRaster/jobs/<jobId>/results/result

JSON Response example

The response returns the results output parameter, which has properties for parameter name, data type, and value. The content of value is always the image service URL.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "paramName": "result",
  "dataType": "GPString",
  "value": {
		  "url": "https://machine.domain.com/webadaptor/rest/services/Hosted/<service name>/ImageServer"
  }
}

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