使用产品:idesktop 10.1.2 操作系统:win10 x64 操作系统内部版本:19042.1415
数据类型: 文件型
问题详细描述:桌面端导入倾斜摄影出现问题,这里的倾斜摄影文件是官方数据“supermap-iobjectsdotnet-10.1.0-18927-82297-all\SampleData\OSGB”
问题重现步骤:
1.打开桌面端
2. 打开\SampleData\OSGB路径下的MaSai.smwu文件
3. 加载里面的OSGB,桌面端闪退崩溃,或者显示导入失败
另外,开发时使用dataImport.ImportSettings.Add(importSettingModelOSG)时,报错,未将对象引用到实例。使用的数据同样为\SampleData\OSGB路径下的compressed.scp。代码如下:
private void AddObliquePhoto(object obj)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
openFileDialog.Title = "导入倾斜摄影文件";
if (openFileDialog.ShowDialog() == true)
{
Workspace ws = ProjectConfig.mWorkspaceControl.WorkspaceTree.Workspace;
ImportSettingModelOSG modelOSG = new ImportSettingModelOSG();
modelOSG.SourceFilePath = openFileDialog.FileName;
modelOSG.TargetDatasetName = Path.GetFileNameWithoutExtension(openFileDialog.FileName);
ImportAndConvert(modelOSG, ws);
}
}
private Dataset ImportAndConvert(dynamic importSetting, Workspace ws)
{
importSetting.TargetDatasource = ws.Datasources[0];
DataImport dataImport = new DataImport();
dataImport.ImportSettings.Clear();
dataImport.ImportSettings.Add(importSetting);// 在此处报错,未将对象引用到实例
dataImport.Run();
Dataset dataset = ws.Datasources[0].Datasets[importSetting.TargetDatasetName];
return dataset;
}