首页 / 浏览问题 / 组件GIS / 问题详情
ImportSettingTIF导入tif栅格文件失败
4EXP 2023年05月10日
使用产品:supermap-iobject .Net 11i V11.0.1

数据类型:工作空间文件为示例数据中的Changchun.smwu,栅格数据为地理空间数据云上下载的Landsat8数据。

问题详细描述:ImportSettingTIF导入tif栅格文件失败,我设置了各个参数均无法成功导入,并且我在iDesktop 10i中成功导入了,并按照桌面版的参数进行了设置,但是依旧不行。此外ImportSettingSHP我也进行了尝试导入shp文件,但是仍失败。求解答,谢谢大家。

代码如下:

                        Datasource datasource = workspace.Datasources[0];
                        if (datasource.IsOpened)
                        {
                            //ImportSettingSHP settingShp = new ImportSettingSHP();
                            //settingShp.SourceFilePath = openFileDialog.FileName;
                            //settingShp.TargetDatasource = datasource;
                            //settingShp.IsImportAs3D = false;
                            //settingShp.ImportMode = ImportMode.None;
                            //settingShp.TargetEncodeType = EncodeType.None;
                            //settingShp.SourceFileCharset = Charset.ANSI;

                            ImportSettingTIF settingTIF = new ImportSettingTIF();
                            settingTIF.IgnoreMode = IgnoreMode.IgnoreNone;
                            settingTIF.ImportingAsGrid = false;
                            settingTIF.ImportMode = ImportMode.None;
                            settingTIF.IsPyramidBuilt = true;
                            settingTIF.MultiBandImportMode = MultiBandImportMode.MultiBand;
                            settingTIF.SourceFileCharset = Charset.Default;
                            settingTIF.SourceFilePath = openFileDialog.FileName;
                            settingTIF.TargetDatasource = datasource;
                            settingTIF.TargetEncodeType = EncodeType.PNG;

                            DataImport dataImport = new DataImport();
                            //dataImport.ImportSettings.Add(settingShp);
                            dataImport.ImportSettings.Add(settingTIF);
                            ImportResult importResult = dataImport.Run();

                            if (importResult.SucceedSettings.Length == 0)
                            {
                                MessageBox.Show("导入失败");
                                return;
                            }
                        }
...