iobjectscpp 9D 910 win10 x64
文件型
数据集叠加分析无结果,但可以进行缓冲分析
1.使用代码生成的缓冲数据集,在桌面版可以叠加,但在代码里面无结果输出。
代码叠加分析结果:
桌面版使用相同数据集叠加分析结果:
叠加分析代码:
UGDatasetVectorInfo* info = new UGDatasetVectorInfo ();
info->m_nType = UGC ::UGDataset ::DatasetType ::Region;
info->m_strName = Translator::QStr2UGStr(buffer_name);
info->m_strTableName = Translator::QStr2UGStr(buffer_name);
UGDatasetVector* datasetresult = m_pWorkspace ->GetDataSource(L"windows")->CreateDatasetVector(*info);
delete info;
info = nullptr;
if(datasetresult == nullptr)
return false;
datasetresult->SetPrjCoordSys(qMapControl->GetMap()->GetPrjCoordSys());
UGOverlayAnalyst *overlay = new UGOverlayAnalyst();
overlay->SetInterval(0.001);
if(overlay->Overlay(dataset1, dataset2, datasetresult, UGC::UGOverlayAnalyst::UGIntersect))
{
QMessageBox::about(this, " ", "yes"); //返回结果正确
}
else
QMessageBox::about(this, " ", "no");
delete overlay;
overlay = nullptr;
UGLayer *layer = qMapControl->GetMap() ->m_Layers.AddDataset (datasetresult);
qMapControl->Refresh ();