URL:
https://<rasteranalysistools-url>/ReduceSpectralBands
Methods:
GET
Version Introduced:
12.2

Description

The ReduceSpectralBands task reduces the number of spectral bands in multiband imagery using Minimum Noise Fraction (MNF) and Principal Components Analysis (PCA) analytical methods.

Request URL:

Use dark colors for code blocksCopy
1
http://<analysis-server-url>/ReduceSpectralBands/submitJob?inputRaster={"itemId":"<raster_item_id>"}&method="PCA"&numberOfComponents=10&outputName={"serviceProperties":{"name":"reduced_bands_raster"}}

Request parameters

ParameterDetails

inputRaster

(Required)

A multiband or hyperspectral image. If the input is a multidimensional raster, the first slice will be used.

The input raster can be the portal item ID, image service URL, cloud raster dataset or shared raster dataset.

Syntax: A JSON object describing the input raster(s).

Example

Use dark colors for code blocksCopy
1
2
3
4
// Single item
{"itemId": <portal item id>}
{"url": <image service url>}
{"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 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 your ArcGIS Enterprise configuration.

Syntax: JSON object describes the output raster.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
outputName={"serviceProperties": {"name": "reduced_bands_raster", "capabilities": "image, metadata"}}
or
outputName={"itemId": <portal item id>}
outputName={"url": <image service url>}
outputName={"uri": <cloud raster uri or shared data path>}

At least one type of input needs to be provided in the JSON object. If multiple inputs are given, the itemId takes the priority.

method

(Optional)

Specifies the reduction method that will be used to transform and reduce the spectral bands.

  • MNF - Minimum Noise Fraction transform will be used. MNF is noise-adjusted PCA, specifically designed for hyperspectral imagery. It estimates the noise covariance matrix, and converts the data so noise has unit variance (noise is normalized so that one unit of variation equals one standard deviation of noise) and is uncorrelated. This is the default.

  • PCA - Principal Components Analysis will be used. It reprojects the original spectral bands into a new set of orthogonal components, ordered by the total variance explained. The first component explains the largest variance (usually containing the most information).

Syntax: A string of one of the above keywords.

Example

Use dark colors for code blocksCopy
1
method=MNF

numberOfComponents

(Optional)

The number of MNF or PCA components that the output will contain. The default value is equal to the number of bands contained in the image; however, if the image has more than 20 bands, then the default will be set to 20.

Syntax: long

Example

Use dark colors for code blocksCopy
1
numberOfComponents=20

outMNFTransformName

(Optional)

This optional raster output is produced when the method parameter is set to MNF. It saves the MNF transformation coefficients used to transform the input image, in the form of number of input bands * (number of components+1). You can use this raster dataset to transform another image using the same coefficients.

Syntax: JSON object describing the output raster.

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
{"serviceProperties": {"name": "out_MNF_transform_raster", "capabilities": "image, metadata"}}

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

outPCALoadingsName

(Optional)

This output table is produced when the method parameter is set to PCA. It lists weights that each input band contributes to the principal components. These weights define the correlations of the input data and the output principal components.

Syntax: JSON object describing the output table.

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "serviceProperties": {
    "name": "out_PCA_loadings",
    "serviceUrl":"https://<servername>/server/rest/services/Hosted/out_PCA_loadings/FeatureServer/0"
  },
  "itemProperties": {
    "itemId":"351fe8441a1a436d8001124487b02550",
    "folderId":"sdfwerfbd3ec25584d0d8f4"
  }
}

outPCAEigenvaluesName

(Optional)

This output is produced when the method parameter is set to PCA. The eigenvalues table indicates the variance percentage of each component. Eigenvalues help you define the number of principal components that are needed to represent the dataset.

Syntax: JSON object describing the output table.

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{"serviceProperties": {"name": "out_PCA_eigenValues"}}

{
  "serviceProperties": {
    "name": " out_PCA_eigenValues",
    "serviceUrl":"https://<servername>/server/rest/services/Hosted/out_PCA_eigenValues/FeatureServer/0"
  },
  "itemProperties": {
    "itemId":"351fe8441a1a436d8001124487b02550",
    "folderId":"sdfwerfbd3ec25584d0d8f4"
  }
}

context

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

  • Cell Size cellSize—Sets the cell size that will be used to create the output raster.
  • Extent extent—Defines the extent of the output raster.
  • Geographic Transformations geographicTransformations — Defines the transformation methods that will be used when projecting the data for analysis.
  • Output Spatial Reference outputSpatialReference—Saves the results in the specified spatial reference.
  • Parallel Processing Factor parallelProcessingFactor—Controls the number of Raster Processing service instances that can be used for processing the data.
  • Resampling Method resamplingMethod —Defines the resampling method used when transforming the data.
  • Snap Raster snapRaster—Adjusts the extent of output rasters so that they match the cell alignment of the specified snap raster.

Example

The following is a sample request URL for ReduceSpectralBands:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/ReduceSpectralBands?inputRaster={"url": "<xxx/ImageServer>"}&method=MNF&numberOfComponents=20&outputName={"serviceProperties":{"name":"<output_name>"}}&context={}&f=json

Response

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

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
"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 the topic Checking job status. Once the job has successfully completed, you 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
http://<analysis url>/ReduceSpectralBands/jobs/<jobId>

Accessing 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.

Status check URL:

Use dark colors for code blocksCopy
1
http://<analysis url>/ReduceSpectralBands/jobs/<jobId>

Result retrieval URL once job succeeds:

Use dark colors for code blocksCopy
1
http://<analysis url>/ReduceSpectralBands/jobs/<jobId>/results/outputRaster?token=<token>&f=json

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