Hi Max,
Thanks for your help. I appreciate you taking to the time to respond.
Yes, I am trying to use the RasterCalc tool from dot net code.
I have tried using your syntax as well as using the workspace environment, and am still encountering the same problem. I noticed your example referenced a png file. I don’t know if using esri GRIDS requires a different approach. However, I interactively ran the raster calculator tool in ArcGIS Pro and the syntax it built on the screen appeared to be the same for GRIDs as well as pngs. I noticed your example referenced Band_1 in the expression piece. The GRIDs I am using only contain one band. However, as an experiment, I did try expressions referencing Band_1 with the same results.
If you don’t mind taking a look, perhaps you can see the error of my ways. The ‘source’ esri GRID directory is located on one of our network drives. For example the source grid would be:
@”\\dom.example\data\snow\sd_20170201” This path points to a GRID directory.
With these parameters I have tried the following:
var expression = @”\\dom.example\data\snow\sd_20170201” + “ * “ + “10000”;
var outputRaster = @”C:\Temp\out_from_rc”;
var parameters = Geoprocessing.MakeValueArray(expression, outputRaster);
var workspace = @”C:\Temp”;
var environments = Geoprocessing.MakeEnvironmentArray(workspace: workspace);
var gpResults = await Geoprocessing.ExecuteToolAsycn(“RasterCalculator”, parameters,environments,CancelableProgressor.None);
I have tried some variations of syntax for the expression, with no luck. I don’t know if using the GRID format introduces different requirements or having the source data and the results data living in different workspaces creates issues. The interactive tool does not seem to mind any of this.
Once again, thanks for responding.