Does IRasterOpBase actually do anything?

Discussion created by ericmweber on Nov 6, 2012
Has anyone ever successfully used the IRasterOpBase interface to make the results of spatial analysis ops permanent? I've tried to use it in the code below with no success. It runs fine, but the output of the transformOp.Clip still just shows up in the temp folder as a grid stack, rather than in the specified workspace as a tiff as it should. The global environment setting "AvoidDataConversion" doesn't have an effect one way or the other, and shouldn't be necessary anyway, if I'm reading the documentation correctly:

        private void ClipSpectral(BinarySample sample, string outFolder, string rasterID)
            IWorkspaceFactory wsf = new RasterWorkspaceFactoryClass();
            IWorkspace ws = wsf.OpenFromFile(outFolder, 0);
            IWorkspaceName workspaceName = (IWorkspaceName)((IDataset)ws).FullName;

            //dataset name
            string spectRasName = rasterID + "spect.tif";
            IDatasetName spectDatasetName = new RasterDatasetNameClass();
            spectDatasetName.Name = spectRasName;
            spectDatasetName.WorkspaceName = workspaceName;

            //new transform op that writes directly to permanent raster
            ITransformationOp transformOp = new RasterTransformationOpClass();
            ((IRasterAnalysisGlobalEnvironment)transformOp).AvoidDataConversion = true;
            ((IRasterOpBase)transformOp).AddOutputDatasetName(0, spectDatasetName);

            IRasterAnalysisEnvironment env = transformOp as IRasterAnalysisEnvironment;
            env.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvValue, sample.SampleEnvelope, m_raster);
            env.OutSpatialReference = ((IGeoDataset)m_raster).SpatialReference;

            IGeoDataset spectRaster = transformOp.Clip(m_raster as IGeoDataset, sample.SampleEnvelope);