Failed to open raster dataset error

3262
3
05-17-2012 08:30 AM
CarlosPiccirillo
New Contributor III
Hi everyone,

The code below has been functioning fine for years in VBA and now C# but suddenly stopped working this week. I can load raster imagery manually but the code below fails on the last line and I get a "failed to open raster dataset" error.

Anyone have an idea what I can do to fix this?

Thanks,
Carlos

IWorkspaceFactory pWorkspaceFactory = new RasterWorkspaceFactory();
IRasterWorkspace pRasterWorkspace = pWorkspaceFactory.OpenFromFile(rasterPath, 0) as IRasterWorkspace;
IRasterDataset pRasterDataset = pRasterWorkspace.OpenRasterDataset(rasterName);
0 Kudos
3 Replies
alexandrudragomir
New Contributor
I have the same problem when I'm trying to access a raster dataset from a geodatabase.
0 Kudos
CarlosPiccirillo
New Contributor III
I am facing a similar problem while accessing a raster from a geoDB. Did you find a solution?


No, I didn't.
0 Kudos
AhmedEl-Sisi
Occasional Contributor III
It's mentioned here that To access raster from geodatabase, use IRasterWorkspaceEx interface.

Regards,
0 Kudos