dshats

Using IRasterDataset3

Discussion created by dshats on May 4, 2010
Latest reply on Jun 29, 2010 by dshats
Hi All,

I try to use interface IRasterDataset3/ReadPyramid method.

I opened my raster using next code:

IRasterDataset3 objmyRaster = OpenFileRasterDataset(@"C:\Maps", @"My100k.tif") as IRasterDataset3;

IRasterDataset OpenFileRasterDataset(string folderName, string datasetName)
        {    //Open raster file workspace   
            IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
            IRasterWorkspace rasterWorkspace = (IRasterWorkspace)workspaceFactory.OpenFromFile(folderName, 0);
            //Open file raster dataset    
            IRasterDataset rasterDataset = rasterWorkspace.OpenRasterDataset(datasetName);   
            return rasterDataset;
        }

The problem that "query interface" to IRasterDataset3  set the object to NULL.

What i am doing wrong?

Thank you.

Outcomes