3

I am primarily following this tutorial.

Here is the signature for the service used in the sample.

It is slightly different than the one I have had any success with, though if I recall correctly the version described below is the only one I could get to ever function.

I have once successfully created my own geoprocessing service that I can utilize no problem. It uses one of my .tif raster layers as input. This image is also published as an Image Service. The signature for this one looks as follows:

Task: CS1 Display Name: CS1

Description: (null)

Category:

Help URL: ......./arcgisoutput/CS1_GPServer/CS1/CS1.htm

Execution Type: esriExecutionTypeAsynchronous

Parameters:

Parameter: inputPoly Data Type: GPString Display Name inputPoly Description: Area to analyze Direction: esriGPParameterDirectionInput Default Value: InputPolygonSample Parameter Type: esriGPParameterTypeRequired Category: Choice List: [ InputPolygonSample ] Parameter: statsSummary Data Type: GPRecordSet Display Name statsSummary Description: Carbon Content of selected polygon Direction: esriGPParameterDirectionOutput Default Value: Fields: OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID ) ID ( type: esriFieldTypeInteger , alias: ID ) COUNT ( type: esriFieldTypeInteger , alias: COUNT ) AREA ( type: esriFieldTypeSingle , alias: AREA ) MIN ( type: esriFieldTypeSingle , alias: MIN ) MAX ( type: esriFieldTypeSingle , alias: MAX ) RANGE ( type: esriFieldTypeSingle , alias: RANGE ) MEAN ( type: esriFieldTypeSingle , alias: MEAN ) STD ( type: esriFieldTypeSingle , alias: STD ) SUM ( type: esriFieldTypeSingle , alias: SUM ) Features: None.

Parameter Type: esriGPParameterTypeRequired Category:

Supported Operations: Submit Job

When calling this service, I use the following methods successfully:

function initTools(evtObj) {
        gp = new Geoprocessor("..../arcgis /rest/services/CS1/GPServer/CS1");
        gp.setOutputSpatialReference({wkid:102100}); 
        gp.on("execute-complete", displayResults);
        gp.on("error", displayError);
        app.toolbar = toolbar = new Draw(evtObj.map);
        toolbar.on("draw-end", computeZonalStats);
    }

function computeZonalStats(evtObj) {
    var geometry = evtObj.geometry;
    /*After user draws shape on map using the draw toolbar compute the zonal*/
    map.showZoomSlider();
    map.graphics.clear();

    var symbol = new SimpleFillSymbol("none", new SimpleLineSymbol("dashdot", new Color([255,0,0]), 2), new Color([255,255,0,0.25]));
    var graphic = new Graphic(geometry,symbol);

    map.graphics.add(graphic);
    toolbar.deactivate();

    var features= [];
    features.push(graphic);

    var featureSet = new FeatureSet();
    featureSet.features = features;

    var params = { "inputPoly":featureSet };
    $("#calcCarbon").button("option", "label", "Calculation in Process...").button("refresh");
    gp.execute(params);
  }

I can process the results as desired.

Now, I am trying to change the image to be a mosaicked image. I create the same tool in ArcGIS, and as far as I remember (which may be fuzzy) use the exact same methods for publishing it.

The resulting signature looks as follows:

Task: CalculateB Display Name: CalculateB

Description:

Category:

Help URL: ...../arcgisoutput/CalculateB_GPServer/CalculateB/CalculateB.htm

Execution Type: esriExecutionTypeAsynchronous

Parameters:

Parameter: inputPoly Data Type: GPString Display Name inputPoly Description: Area to analyze Direction: esriGPParameterDirectionInput Default Value: SampleInputPoly Parameter Type: esriGPParameterTypeRequired Category: Choice List: [ SampleInputPoly ] Parameter: statsSummary Data Type: GPRecordSet Display Name statsSummary Description: Carbon Content of selected polygon Direction: esriGPParameterDirectionOutput Default Value: Fields: OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID ) ID ( type: esriFieldTypeInteger , alias: ID ) COUNT ( type: esriFieldTypeInteger , alias: COUNT ) AREA ( type: esriFieldTypeSingle , alias: AREA ) MIN ( type: esriFieldTypeSingle , alias: MIN ) MAX ( type: esriFieldTypeSingle , alias: MAX ) RANGE ( type: esriFieldTypeSingle , alias: RANGE ) MEAN ( type: esriFieldTypeSingle , alias: MEAN ) STD ( type: esriFieldTypeSingle , alias: STD ) SUM ( type: esriFieldTypeSingle , alias: SUM ) Features: None.

Parameter Type: esriGPParameterTypeRequired Category:

Supported Operations: Submit Job

When I try and run this service, using the exact same code as above simply substituting the URL for the Geoprocessor, I receive the following error almost instantly (it does not even seem to access my server for the error based on the speed of the response).

Error: Error performing execute operation
.cache["esri/request"]/</t/f.load()/3.7/ (line 772)
.cache["dojo/_base/xhr"]/</b._ioSetArgs/<()/3.7/ (line 184)
c()/3.7/ (line 74)
d()/3.7/ (line 74)  
()/3.7/ (line 75)
c()/3.7/ (line 74)
d()/3.7/ (line 74)
()/3.7/ (line 75) 
.cache["dojo/_base/xhr"]/</b.xhr/<()/3.7/ (line 188) 
.cache["dojo/Deferred"]/</l()/3.7/ (line 193)
.cache["dojo/Deferred"]/</r()/3.7/ (line 192)
()/3.7/ (line 195)
.cache["dojo/Deferred"]/</a()/3.7/ (line 193)
.cache["dojo/Deferred"]/</l()/3.7/ (line 193)
.cache["dojo/Deferred"]/</r()/3.7/ (line 192)
()/3.7/ (line 195)
.cache["dojo/Deferred"]/</a()/3.7/ (line 193)
...ost,w=e.crossOrigin):v=!!e);f=p.mixin({},f);f._ssl&&(f.url=f.url.replace(/^http:...

Throughout this process I have recreated and deleted the second service several times. I've noticed sometimes, if I didn't change the name of the service, the signature did not update (I was fiddling with the different input types to try and get the two to match perfectly). I am continuing to test to see if possibly somehow an outdated version is being accessed.

My second mosaicked image is NOT published as an image service (though I think this shouldn't matter). I also spent a long time working on getting that first service to work, so if the theory about outdated signatures is correct, it may not be exactly what I am being shown. However, previously when I had trouble getting the service to run, I would get a result back from the server stating invalid parameters or something similar, very different from this one which does not even seem to go there.

Does anyone know more specifically in what area I may be going wrong? All leads are greatly appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.