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

Description

The DetectImageAnomalies task processes a multiband or hyperspectral image and creates an anomaly score raster. An anomaly score raster is a single band raster, with values between 0 and 1.

Request parameters

ParameterDetails

inputRaster

(Required)

A multiband or hyperspectral image. The input raster can be the portal item ID, 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>}

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 the Raster Analysis Image Server or Image Hosting Image Server depending on the Enterprise configuration.

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 anomaly calculation method that will be used. The RXD method extracts pixels that are significantly different from the background pixel values. This is the default. The UTD method extracts background pixels from the input image. The KMEANS method extracts pixels that significantly deviate from the established clusters in the data using K-means clustering algorithms.

Values: RXD | UTD | KMEANS

numClusters

(Required if method is KMEANS.)

The number of clusters that will be used. This parameter is not used for the other methods.

Syntax: long

Example

Use dark colors for code blocksCopy
1
numClusters=2

backgroundRegion

(Optional)

A polygon feature layer that defines the region to be used to calculate background statistics when the method parameter is set to RXD or UTD. This parameter is not used when the method is set to KMEANS.

Syntax: This parameter can be specified as a URL to a feature service layer

Example

Use dark colors for code blocksCopy
1
2
3
//Feature layer url

"backgroundRegion":{"url":<feature service layer url>}

recomputeStats

(Optional)

Specifies whether statistics will be recomputed for the output score raster when the method parameter is set to RXD or UTD. The RXD and UTD options require accurate statistics in which the skip factor must be 1. When set as true, statistics will be recomputed for the output score raster. This is the default. When set as false, statistics will not be recomputed for the output score raster. This parameter is not used when set to KMEANS.

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 for URL for DetectImageAnomalies:

Use dark colors for code blocksCopy
1
https://organization.example.com/server/rest/services/System/RasterAnalysisTools/GPServer/DetectImageAnomalies?inputRaster={"url": "<xxx/ImageServer>"}&outputName={"serviceProperties":{"name":"<output_name>"}}&method=RXD&backgroundRegion={"url": "<xxx/FeatureServer/0>"}&recomputeStats=true&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>/DetectImageAnomalies/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>/DetectImageAnomalies/jobs/<jobId>

Result retrieval URL once job succeeds:

Use dark colors for code blocksCopy
1
https://<analysis url>/DetectImageAnomalies/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.