XRasterIOGetSubDatasets Method |
Namespace: Pixoneer.NXDL.NIO
public string[] GetSubDatasets( string strFileName )
XRasterIO RasterIO = new XRasterIO(); string strError = ""; if (!RasterIO.Initialize(out strError)) { MessageBox.Show(strError); } string strFilters = RasterIO.GetFiltersForLoad(); OpenFileDialog openDlg = new OpenFileDialog(); openDlg.Filter = strFilters; openDlg.RestoreDirectory = true; openDlg.Multiselect = false; bool bRes = (bool)openDlg.ShowDialog(); if (bRes == false) return; string filepath = openDlg.FileName; List<XRSLoadFile> listXrsLoadFile = new List<XRSLoadFile>(); string[] arrSubDataset = RasterIO.GetSubDatasets(filepath); if (arrSubDataset != null && arrSubDataset.Length > 0) { // SubDataset이 있는 K5 영상 로딩할 경우 // arrSubDataset = {"1 : SwathID 01", "2 : SwathID 02", "3 : SwathID 03", "4 : SwathID 04"} // *.h5 로딩 => *_S01.xld, *_S02.xld, *_S03.xld, *_S04.xld 의 xld 파일 생성되고 로딩됨. for (int i = 0; i < arrSubDataset.Length; i++) { XRSLoadFile xrsLoadFile = RasterIO.LoadFile(filepath, out strError, false, eIOCreateXLDMode.All_NoMsg, true, i, null); if (xrsLoadFile != null) listXrsLoadFile.Add(xrsLoadFile); } } else { XRSLoadFile xrsLoadFile = RasterIO.LoadFile(filepath, out strError, false, eIOCreateXLDMode.All_NoMsg, true, null); if (xrsLoadFile != null) listXrsLoadFile.Add(xrsLoadFile); }