//create IRasterWorkspaceEx rWS = (IRasterWorkspaceEx)ws; IRasterStorageDef2 rStorage = new RasterStorageDefClass(); rStorage.CellSize = new Pnt(){X=cellsize,Y=cellsize}; rStorage.Origin = origin; IRasterDef2 rDef = new RasterDefClass(); rDef.SpatialReference = srOut; rds = (IRasterDataset2)rWS.CreateRasterDataset(strName, 1, ptype, rStorage, "", rDef, null);
IRasterBandCollection rbc = (IRasterBandCollection)rds; IRasterProps rProps = (IRasterProps)rbc.Item(0); rProps.NoDataValue = nodataval; rProps.Width = Data.GetLength(0); //Error here rProps.Height = Data.GetLength(1);
Solved! Go to Solution.
IRasterWorspace2 is used to access a raster stored in a file system in any supported raster format. To access raster from geodtabase, use IRasterWorkspaceEx interface.