URL:
https://<rasteranalysistools-url>/ResampleLibrarySpectra
Methods:
GET
Version Introduced:
12.1

Description

The ResampleLibrarySpectra task resamples the bands of a spectral library to match the bands of a target spectral library or image, producing a new spectral library file. The target spectral library or image can be predefined from a list of common sensors, or it can be based on a custom image or spectra.

Request parameters

ParameterDetails

inputLibrarySpectra

(Required)

An Esri spectral library or ENVI spectral library file with wavelength information.

The input can be the Portal ItemID.

Syntax: A JSON object describing the input library spectra.

Example

Use dark colors for code blocksCopy
1
{"itemId": <portal item id>}

inputSpectra

(Required)

Esri Spectral Library item ID. The item can be published from a spectral library file containing spectral signatures, or from a point feature class created by the training sample manager in classification tools in ArcGIS Pro.

Syntax: JSON object describes the input spectra(s).

Example

Use dark colors for code blocksCopy
1
2
{"itemId": <portal item id>}
{“url”: <feature service url>}

outputName

(Required)

The output Esri spectral library file with the resampled wavelength information.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
//item properties
{"name": "findtrees", "folderId": "nodsfiajoirejiojenoiwnioew", "itemProperties": {}}

//uri
{“uri”:<path>}

targetSensor

(Required)

Specifies the target spectra, or a custom spectra library file or image, that contains the target spectra.

  • LANDSAT-9—The target spectra will be Landsat 9 satellite data with 7 bands.
  • LANDSAT-8—The target spectra will be Landsat 8 satellite data with 7 bands.
  • LANDSAT-7_NO_THERMAL—The target spectra will be Landsat 7 satellite data with 6 bands.
  • LANDSAT-5_NO_THERMAL—The target spectra will be Landsat 5 satellite data with 6 bands.
  • LANDSAT-4_NO_THERMAL—The target spectra will be Landsat 4 satellite data with 6 bands.
  • SENTINEL-3—The target spectra will be Sentinel-3 satellite data with 21 bands.
  • SENTINEL-2A—The target spectra will be Sentinel-2A satellite data with 13 bands.
  • SENTINEL-2B—The target spectra will be Sentinel-2B satellite data with 13 bands.
  • ASTER_BANDS_1_TO_9—The target spectra will be ASTER satellite data with 10 bands.
  • CUSTOM_TARGET_IMAGE_OR_SPECTRA—A custom spectral library file or image that contains the target spectra will be used. This is the default.

customTargetImageOrSpectra

(Optional)

A custom spectral library file or image with wavelength information that contains the target spectra.

This parameter is active when the targetSensor parameter value is CUSTOM_TARGET_IMAGE_OR_SPECTRA.

Example:

Use dark colors for code blocksCopy
1
2
3
{"itemId": <portal item id>}
{"url": <image service url>}
{"uri": <cloud raster uri or shared data path>}

customTargetImageOrSpectra

(Optional)

Specifies the resampling method that will be used for the output library spectra.

  • BAND_AVERAGING—A simple average of the input spectra based on all band values that fall within each target band’s wavelength range will be used. This is the default.
  • GAUSSIAN_CONVOLUTION—A Gaussian model will be used to represent the spectral response function of the sensor, and the input band values will be weighted for each wavelength range.

Syntax: string

Use dark colors for code blocksCopy
1
"resamplingMethod": BAND_AVERAGING

Example

The following is a sample request for URL for ResampleLibrarySpectra:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/ResampleLibrarySpectra?inputLibrarySpectra= {"itemId": "53e0085ff8ae4a318ec0e6fa84afbdcf"}&targetSensor=CUSTOM_TARGET_IMAGE_OR_SPECTRA&customTargetImageOrSpectra={"url": "xxx/ImageServer"}&resamplingMethod= GAUSSIAN_CONVOLUTION&outputName={"name":"output_name"}&f=json

Response

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

Use dark colors for code blocksCopy
1
2
3
4
5

{
"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
https://<analysis url>/ResampleLibrarySpectra/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
https://<analysis url>/ResampleLibrarySpectra/jobs/<jobId>

Result retrieval URL once job succeeds:

Use dark colors for code blocksCopy
1
https://<analysis url>/ResampleLibrarySpectra /jobs/<jobId>/results/outputLibrarySpectra?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.