Failed to open raster dataset error

2979
3
05-17-2012 08:30 AM
Highlighted
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);
Reply
0 Kudos
3 Replies
Highlighted
New Contributor
I have the same problem when I'm trying to access a raster dataset from a geodatabase.
Reply
0 Kudos
Highlighted
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.
Reply
0 Kudos
Highlighted
Occasional Contributor III
It's mentioned here that To access raster from geodatabase, use IRasterWorkspaceEx interface.

Regards,
Reply
0 Kudos