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

Description

The DetectTargetUsingSpectra task processes a multiband or hyperspectral image and identifies pixels in an image that match a spectral signature. The output will be a multiband raster if the library file contains multiple spectral signatures.

Request parameters

ParameterDetails

inputRaster

(Required)

A multiband or hyperspectral image. Wavelength information is required when the target spectra is a library file, and a surface reflectance raster is recommended if the target spectra data is from a spectral library.

The input raster can be the Portal ItemID, Image Service URL, cloud raster dataset or shared raster dataset.

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

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
//Item ID
{"itemId": <portal item ID>}

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

Cloud raster URI/shared data path
{"uri": <cloud raster URI or shared data path>}

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)

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 new hosted image service with the given service properties. The output hosted image service is stored in a raster store and shared on either an ArcGIS Image Server with the raster analysis role or an ArcGIS Image Server with an image hosting role, depending on the configuration of ArcGIS Enterprise.

Syntax: JSON object describes the output raster.

Example

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

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 method that will be used to compute the matching scores from the input image and the spectral signature file. All scores are normalized from 0 to 1 in which a higher score is a better match.

  • SAM—The Spectral Angle Mapper method will be used to compute the matching scores. This is the default.
  • SIDThe Spectral Information Divergence method will be used to compute the matching scores.
  • SIDSAM—A combination of the Spectral Information Divergence and Spectral Angle Mapper methods will be used to compute the matching scores.
  • NS3—The Normalized Spectral Similarity Score method will be used to compute the matching scores.
  • ACE—The Adaptive Cosine Estimator method will be used to compute the matching scores.
  • CEM— The Constrained Energy Minimization method will be used to compute the matching scores.
  • MF—The Matched Filter method will be used to compute the matching scores.

Syntax: A string of one of the above keywords.

Example

Use dark colors for code blocksCopy
1
method="SAM"

removeContinuum

(Optional)

A boolean value to specify whether the spectra will be normalized from an image or reference data. When set as true, the spectra will be normalized from an image or reference data. When false, the spectra will not be normalized from an image or reference data. The default value is false.

Values: true | false

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 DetectTargetUsingSpectra:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/DetectTargetUsingSpectra? inputRaster={"url": "<xxx/ImageServer>"}& inputSpectra= {"itemId": "53e0085ff8ae4a318ec0e6fa84afbdcf"}&method= SIDSAM& removeContinuum=true& outputName= {"serviceProperties":{"name":"<output_name>"}}&context={}&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
6

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 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>/DetectTargetUsingSpectra/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>/DetectTargetUsingSpectra/jobs/<jobId>

Result retrieval URL once job succeeds:

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