Select to view content in your preferred language

How the fetch Raster from the REST Service

56
0
Tuesday
SerdemGün
New Contributor

I’m trying to run a custom Python geoprocessing (GP) tool published to ArcGIS Enterprise Server that takes GPFeatureLayer (Lines, Points) and Raster Layer as input (an ImageServer URL) and wrote a Custom Widget in ArcGIS Javascript SDK. But i can't seem to get the Raster Data and use it. The tool itself works fine in the ArcGIS Pro.

I developed other GP Tools without Raster Data and published to Server and they seem to working.

What should I pay attention to? In Python code i use CopyRaster to download the raster then use it and it works just fine in the ArcGIS.

 

REST Services Raster: 

Parameter: input_raster
Data Type: GPRasterDataLayer
Display Name Input Raster Layer
Description: Raster
Direction: esriGPParameterDirectionInput
Filter:
Dependency:
Default Value:
Parameter Type: esriGPParameterTypeRequired
Category:

In the JS Script i fetch the raster like this: 

const params: any = { input_raster: { url: rasterLayerUrl },
const jobInfo = await geoprocessor.submitJob(gpUrl, params);
await jobInfo.waitForJobCompletion({}
const resultLayer = await jobInfo.fetchResultMapImageLayer(
          jobInfo.jobId
        );

But i get errors like: Failed to access URL, Job failed, unable to parse json value of the parameter.

Tried public ImageryServices too but same error
0 Kudos
0 Replies