What is the equivalent of raster save using ArcGIS Pro SDK C#
Arcpy Code
in_raster = Raster('c:/data/inraster')
new_raster.save('c:/output/outraster1')
Given this example here - Executing Spatial Analyst Tools Using ArcGIS Pro SDK
Typically you could just set the output raster in the Value Array, as done here
var valueArray = Geoprocessing.MakeValueArray(maExpression, outRaster);
var gpresult1 = await Geoprocessing.ExecuteToolAsync(RasterCalculator_sa, valueArray);
However that changes, if the tool you are running does not have an output raster that you can set. The CutFill Spatial Analyst returns a raster, but I would like to save that raster somewhere instead of using CopyRaster.
for example, Cut Fill (Spatial Analyst)—ArcGIS Pro | Documentation
var valueArray = Geoprocessing.MakeValueArray(inputRasterOne, inputRasterTwo);
var gpresult1 = await Geoprocessing.ExecuteToolAsync(CutFill_sa, valueArray);
based on my friend's answer Gintautas Kmieliauskas,
the correct solution is to put the output raster in the value array.
For my example, I referenced ArcGIS 9.3 Cut Fill and followed the same and it worked.
var valueArray = Geoprocessing.MakeValueArray(inputRasterOne, inputRasterTwo, outputRaster);
var gpresult1 = await Geoprocessing.ExecuteToolAsync(CutFill_sa, valueArray);
Solved! Go to Solution.
Hi Douglas,
The same situation is with Euclidean distance geoprocessing tool. Look at this how I do in that case:
Hi Douglas,
The same situation is with Euclidean distance geoprocessing tool. Look at this how I do in that case: