使用产品:SuperMap iObjects .NET 11i V11.0.1
数据类型:工作空间、数据源即示范数据中的Changchun.smwu,导入的栅格数据是地理空间数据云上下载的Landsat8数据
问题详细描述:使用ImportSettingTIF导入失败,我设置了各种参数,依旧不行。此外,在iDesktop 10i中可以正常导入,我也按照桌面版中的参数进行了设置,还是不行。包括ImportSettingSHP我也尝试了,也是失败。求解答,谢谢大家。
代码如下:
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;
}
}