Add Raster using ArcGIS Rest API through jQuery

324
6
Jump to solution
02-08-2018 09:39 AM
Wondimagegn_TesfayeCIAT
New Contributor

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

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor
As the help documentation states:
Add Rasters
LicenseLicense: As of 10.5, you must license your ArcGIS Server as an ArcGIS Image Server in order to use this resource.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

The Image Server service has to be enabled to allow for adding Rasters.

http://climatewizard.ciat.cgiar.org/arcgis/sdk/rest/index.html#/Add_Rasters/02ss0000006r000000/ 

0 Kudos
Wondimagegn_TesfayeCIAT
New Contributor

I see! How could I enable the Image Server service? I have also published some image services already here.

targeting_tools/africa_annual_precipitation (ImageServer) 

I though it was enabled. 

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor
0 Kudos
Wondimagegn_TesfayeCIAT
New Contributor

Unfortunately, there is no option for Upload and download and other useful capabilities. Is it missing because of the type of ArcGIS version? 

Only three capabilities

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor
As the help documentation states:
Add Rasters
LicenseLicense: As of 10.5, you must license your ArcGIS Server as an ArcGIS Image Server in order to use this resource.
0 Kudos
Wondimagegn_TesfayeCIAT
New Contributor

Oh I see the problem now. Thank you very much for the help!

0 Kudos