ellisrj

Altering compression of Geoprocessor output raster

Discussion created by ellisrj on Feb 4, 2013
I'm trying to implement LZW compression on TIFFs that are being written as part of a Geoprocessor execution that is implementing a RasterCalculator expression. I have (unsuccessfully) tried to alter the tiff.pdf default settings in C:\ArcGIS\arcexe10x\raster\defaults, and have also tried to use 'SetEnvironmentValue', as per the code below. I can set extents, cell size etc via 'SetEnvironmentValue', but I am seeing no decrease in output raster size (~ 18300 cols, 28000 rows, 4GB size).

Has anyone had any success altering the compression of raster outputs from geoprocessor executions in Arc Objects? I'm using ArcGIS 10, service pack 2, build 3200, obviously with Spatial Analyst license 'checked out' for the processing.

Thanks

Rob

Geoprocessor rasGP = new Geoprocessor();
rasGP.SetEnvironmentValue("workspace", existingRasterDIRInput.Text);

string baseRasterExtent = rasInfo.Extent.XMin + " " + rasInfo.Extent.YMin + " " + rasInfo.Extent.XMax + " " + rasInfo.Extent.YMax;

rasGP.SetEnvironmentValue("extent", baseRasterExtent);
rasGP.SetEnvironmentValue("compression", "LZW");

RasterCalculator RasterCalc = new RasterCalculator();

string outRasterPathTif = newRasterDIRInput.Text + "\\" + System.IO.Path.GetFileNameWithoutExtension(valRasterPath) + ".tif";
RasterCalc.output_raster = outRasterPathTif;

rasGP.Execute(RasterCalc, null);

Outcomes