AnsweredAssumed Answered

Add Raster using ArcGIS Rest API through jQuery

Question asked by wondim81_CIAT on Feb 8, 2018
Latest reply on Feb 8, 2018 by wondim81_CIAT

Dear Community,

 

I am trying to publish image server when a user uploads a file on a Web App Builder app. I tried to use esriRequest to make the request but it is only submiting it as GET even with usePost: true. That is one problem but not the major for now. 

 

The code below results in 400 error code. 

The image service url is 

http://climatewizard.ciat.cgiar.org/arcgis/rest/services/targeting_tools/africa_land_use/ImageServer/

 

var wkid = this.map.spatialReference;
var srid = wkid.wkid;
var params = {
    'itemIds': itemID,
    'rasterType': 'Raster Dataset',
    'f': 'json',
    "spatialReference": {'wkid':srid}
    // 'computeStatistics': true
};
var self = this;

$.ajax({
    type: "POST",
    url: self.config.imageServiceUrl + 'add',
    data: params,
    success: requestSucceeded,
    dataType: 'json'
});

The response is the following. 

{"error":{"code":400,"message":"Requested operation is not supported by this service.","details":[]}}

From the message the image service URL is not able to add raster but I don't know how to create a service that allows adding raster. Could you please help on this one. 

 

Versions being used.

ArcGIS for Servers 10.5

ArcGIS Javascript API 3.22

Outcomes