Hello,
I am trying to bulk process a number of grids and export out geotiffs. I have been able to use IRasterLayerExport3 to create an RGB geotiff. However they all have black for a background as the tiff only saves with 3 bands, rather than having a four band RGBA. This is my first attempt at using the SDK
I am trying to emulate the ArcPro export raster functionality to save a raster with a color ramp.
The code I currently use looks like this:
IMapDocument pmapDocument = new MapDocument();
IMap pmap;
pmapDocument.Open(layerName);
pmap = pmapDocument.get_Map(0);
ILayer layer = pmap.Layer[0];
IRasterLayer rlayer = layer as IRasterLayer;
IRasterLayerExport3 r3 = (IRasterLayerExport3)r_export;
ISaveAs2 save_as = (ISaveAs2)rlayer;
r3.Force2RGB = true;
r3.NoData = 0;
r3.RasterLayer = rlayer;
IRasterWorkspace out_Workspace = OpenFileWorkspace(wsName);
IWorkspace ow = (IWorkspace)out_Workspace;
r3.Export(ow, outName, "TIFF");
Am I missing another process that I should be using instead of this?
Thanks