打开镶嵌数据集:
IMosaicDataset GetMosaicDataset(string pFGDBPath,string pMDame)
{
IWorkspaceFactory pWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
IWorkspace pFgdbWorkspace = pWorkspaceFactory.OpenFromFile(pFGDBPath, 0);
IMosaicWorkspaceExtensionHelper pMosaicExentionHelper = new
MosaicWorkspaceExtensionHelperClass();
IMosaicWorkspaceExtension pMosaicExtention =
pMosaicExentionHelper.FindExtension(pFgdbWorkspace);
return pMosaicExtention.OpenMosaicDataset(pMDame);
}
创建一个镶嵌数据集:
IMosaicDataset CreateMosaicDataset(string pFGDBPath, string pMDame,
ISpatialReference pSrs )
{
IWorkspaceFactory pWorkspaceFactory = new FileGDBWorkspaceFactory();
IWorkspace pFgdbWorkspace = pWorkspaceFactory.OpenFromFile(pFGDBPath, 0);
ICreateMosaicDatasetParameters pCreationPars = new
CreateMosaicDatasetParametersClass();
pCreationPars.BandCount = 3;
pCreationPars.PixelType = rstPixelType.PT_UCHAR;
IMosaicWorkspaceExtensionHelper pMosaicExentionHelper = new
MosaicWorkspaceExtensionHelperClass();
IMosaicWorkspaceExtension pMosaicExtention =
pMosaicExentionHelper.FindExtension(pFgdbWorkspace);
return pMosaicExtention.CreateMosaicDataset(pMDame, pSrs, pCreationPars,
"");
}