Select to view content in your preferred language

Geoprocessing Service output File(csv) access

366
0
02-02-2022 06:02 PM
Paco
by
Frequent Contributor

Hello all,   I have created a Geoprocessing Service(clip raster, export xyz values to .csv file) for a Webapp.  the tool runs and actually outputs the clipped raster(tif) and the .csv file to the Server scratch locations:

\arcgisjobs\ngs\cliprasterxyz_b_gpserver\xxjobidxx\scratch

REST

/server/rest/directories/arcgisjobs/ngs/cliprasterxyz_b_gpserver/xxjobidxx/scratch 

/server/rest/services/NGS/ClipRasterXYZ_b/GPServer/ClipRasterXYZ/jobs/xxjobidxx/results/Table_xyz

 

So,  the files exist, i see them.   I am able to add the raster to the webmap using Javascript "getResultMapImageLayer",  BUT i cannot seem to read the contents of the .csv file using "getResultData"?

the DataType of the output Parameter is "File".

here are some JS snippets - the console shows empty or 'undefined'..

 

var params = {
Clip_input: featureSet,
//Table_xyz: "Table_xyz.csv",
};

var geoprocessor = new Geoprocessor("https://server_name/server/rest/services/NGS/ClipRasterXYZ_b/GPServer/ClipRasterXYZ ");


geoprocessor.submitJob(params).then(function(jobInfo) {
let jobid = jobInfo.jobId;

let options = {
interval: 2500,
statusCallback: function(j) {
console.log("Job Status: ", j.jobStatus);
}
};

geoprocessor.waitForJobCompletion(jobid, options).then(function() {
geoprocessor.getResultMapImageLayer(jobInfo.jobId).then(function(layer){
view.map.add(layer);
console.log("layer_",layer.url);

geoprocessor.getResultData(jobInfo.jobId, "Table_xyz").then(function(table){
//makePlotly(r)
console.log("table_", table.url);
});
});

 

*BONUS question!?    why are there 2 REST service URLs as i listed above?  which url should i be using??

cheers!

 

 

 

 

 

0 Kudos
0 Replies