AnsweredAssumed Answered

Error with geoprocessor

Question asked by Alfonso_CLUS on Mar 15, 2018
Latest reply on Mar 16, 2018 by Alfonso_CLUS

Hello all,

 

I have an error using the geoprocessor in JS to obtain summaries of elevation and slope.

 

gp = new Geoprocessor("http://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation");
inputFeatures = new FeatureSet();
inputFeatures.features = this.aoiGraphicsLayer.graphics;
inputFeatures.fields = this.parcelsLayer.fields;
params = {"InputFeatures": inputFeatures,
                  "DEMResolution": "FINEST",
                  "IncludeSlopeAspect": true
                  };
gp.submitJob(params, lang.hitch(this, function(results){

..........

}, function(error){
                console.log("    GP ERROR:", error);

});

 

the aoiGraphicsLayer is populated with polygons that can be obtained from different ways: selecting a feature from a layer, uploading a shapefile or drawing it with the draw tool.

I have the "Cyclic Object Value Error" only if the polygon comes from the draw tool. The error is triggered when submit the job, however is never caught by the function error in the submit. If the polygons come by selecting or a shapefile the job is submitted well.

I know that this error is due to the object (feature) has properties that point to each other in a cycle. I reviewed the structure and I didn't find between the graphics from the draw tool and the other ones.

Any suggestion?

 

Thanks,

 

Alfonso

Outcomes