ArcSDE 93 or higher is not supported by RasterSdeLoader

来源:互联网  时间:2016/6/24 12:43:51

关于网友提出的“ ArcSDE 93 or higher is not supported by RasterSdeLoader”问题疑问,本网通过在网上对“ ArcSDE 93 or higher is not supported by RasterSdeLoader”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: ArcSDE 93 or higher is not supported by RasterSdeLoader
描述:

本帖最后由 shujujiegougou 于 2013-10-18 07:15:02 编辑

在开发过程中,使用了以下代码,想使用tif数据入库(SDE数据库)的功能。

//加载影像数据到SDE数据库
        private void button4_Click(object sender, EventArgs e)
        {          
            this.openFileDialog1.Filter = "TIFF file (*.tif)|*.tif";
            this.openFileDialog1.Title = "打开影像数据";
            this.openFileDialog1.Multiselect = false;
            string fileName = "";
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                fileName = this.openFileDialog1.FileName;
                string filepath;
                string file;
                int lastIndex;
                lastIndex = fileName.LastIndexOf(@"\");
                filepath = fileName.Substring(0, lastIndex);
                file = fileName.Substring(lastIndex + 1);
               
                //导入SDE数据库 
                rasterWorkspace = workspace as IRasterWorkspaceEx;
                IWorkspaceFactory tifwpf = new RasterWorkspaceFactoryClass();
                IWorkspace tifwp = tifwpf.OpenFromFile(filepath, 0);
                IRasterWorkspace tifrwp = tifwp as IRasterWorkspace;
                IRasterDataset rasterDataset = tifrwp.OpenRasterDataset(file);                
                IRasterDataset sdeRasterDataset = null;               
                lastIndex = file.LastIndexOf(@".");
                file = file.Substring(0, lastIndex);
                try
                {
                    sdeRasterDataset = rasterWorkspace.OpenRasterDataset(file);
                }
                catch (Exception Ex)
                {
                }
                if (sdeRasterDataset == null)
                {
                    IBasicRasterSdeConnection sdeCon = new BasicRasterSdeLoader();
                    IPropertySet propertySet = new PropertySetClass();
                    propertySet = workspace.ConnectionProperties;
                    //建立与SDE数据库的连接
                    sdeCon.ServerName = propertySet.GetProperty("server").ToString();
                    sdeCon.Instance = propertySet.GetProperty("instance").ToString();
                    sdeCon.UserName = propertySet.GetProperty("user").ToString();
                    sdeCon.Database = propertySet.GetProperty("database").ToString();
                    sdeCon.SdeRasterName = file;
                    sdeCon.InputRasterName = fileName;
                    
                    //保存影像数据到SDE数据库中
                    IRasterSdeServerOperation rasterSdeServeroperation = sdeCon as IRasterSdeServerOperation;
                    rasterSdeServeroperation.Create();
                    rasterSdeServeroperation.Update();
                    rasterSdeServeroperation.ComputeStatistics();
                }
            }
        }
    }

但是在调试的时候,到rasterSdeServeroperation.Create();这行的时候,会提示ArcSDE 9.3 or higher is not supported by RasterSdeLoader。
我本机是ArcGIS Engine 10.0版本。我查网上说RasterSdeLoader接口已经被弃用了,现在推荐使用其它接口。现在有10.0版本可以用的,栅格数据入库的代码吗?

上一篇小白请教三维地图的实现
下一篇请教一下关于AE拓扑的问题
明星图片
相关文章
《 ArcSDE 93 or higher is not supported by RasterSdeLoader》由码蚁之家搜集整理于网络,
联系邮箱:mxgf168#qq.com(#改为@)