- URL:
- https://<rasteranalysistools-url>/ExtractSpectraFromImage
- Methods:
GET- Version Introduced:
- 12.2
Description
The Extract task extracts spectral signatures from input feature data to create an Esri Spectral Library (.esl) file. The reference spectral data may be collected from the field, such as GPS data, in the form of point or polygon features. These features record the locations of the materials of interest, or class types.
Request URL:
http://<analysis-server-url>/ExtractSpectraFromImage/submitJob?inputRaster={"itemId":"<raster_item_id>"}&inputLocationFeature={"itemId":"<feature_item_id>"}&materialNameField="ClassName"&outputName={"serviceProperties":{"name":"extracted_spectra"}}Request parameters
| Parameter | Details |
|---|---|
(Required) | A multispectral or hyperspectral image that contains wavelength information. 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 |
(Required) | A point or polygon feature class that defines the locations of the target materials. If the location features are polygons, an average spectra will be created for each polygon and each material type. The reference spectral data can be collected from the field or from a target image using the Training Sample Manager in ArcGIS Pro. Syntax: A JSON object describing the input feature data. Example |
(Required) | A field from the input location feature class that identifies the material or class name for each feature. This field value is used to label the spectral signatures in the output spectral library. Syntax: string Example |
(Required) | The output Esri Spectral Library (.esl) file that stores the extracted spectral signatures. The output can be stored as a new hosted item in the portal. Example |
(Optional) | Specifies whether to aggregate spectra from all input features associated with a material. The default is
|
| Contains additional settings that affect task execution. This task has the following settings:
|
Example
The following is a sample request URL for Extract:
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/ExtractSpectraFromImage?inputRaster={"url": "<xxx/ImageServer>"}&inputLocationFeature={"itemId": "53e0085ff8ae4a318ec0e6fa84afbdcf"}&materialNameField="ClassName"&aggregateSpectra="true"&outputName={"serviceProperties":{"name":"<output_name>"}}&context={}&f=jsonResponse
When you submit a request, the service assigns a unique job ID for the transaction.
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:
http://<analysis url>/ExtractSpectraFromImage/jobs/<jobId>Accessing results:
When the status of the job request is esri, you can access the results of the analysis by making a request of the following form.
Status check URL:
http://<analysis url>/ExtractSpectraFromImage/jobs/<jobId>Result retrieval URL once job succeeds:
http://<analysis url>/ExtractSpectraFromImage/jobs/<jobId>/results/outputSpectra?token=<token>&f=json