IMapAlgebraOp::Execute returns "Failed to open raster dataset" if the raster is not accessed as a layer from the MapDocument.
Last Published: August 25, 2014ArcGIS Engine
Bug ID Number
NIM038737
Submitted
September 24, 2008
Last Modified
June 5, 2024
Applies to
ArcGIS Engine
Version found
9.3
Status
Will Not Be Addressed
The development team has considered the issue or request and concluded it will not be addressed. The issue's Additional Information section may contain further explanation.
Additional Information
No Public Explanation
Workaround
Use the Conversion tools instead//Initialize esriLicenseProductCode productCode = ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcEditor; AoInitialize aoInit = new AoInitializeClass(); if (aoInit.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable) { aoInit.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst); aoInit.Initialize(productCode); } IWorkspaceFactory rwsf = new RasterWorkspaceFactoryClass(); IWorkspace ws = rwsf.OpenFromFile("C:\\Temp",0); IRasterWorkspace2 rws2 = ws as IRasterWorkspace2; IRasterDataset rds = rws2.OpenRasterDataset("TestGrid"); IRaster raster = rds.CreateDefaultRaster(); IWorkspaceFactory swsf = new ESRI.ArcGIS.DataSourcesFile.ShapefileWorkspaceFactoryClass(); IWorkspace sws = swsf.OpenFromFile("C:\\Temp",0); string sOutFCName = "myShapefile2.shp"; IConversionOp convOp = new RasterConversionOpClass(); IGeoDataset rastergds = raster as IGeoDataset; IGeoDataset geoFCOut = convOp.RasterDataToPointFeatureData(rastergds, sws, sOutFCName);