|
XRasterIOGetSubDatasets Method
|
파일의 하위 데이터 집합이 있는 경우 데이터집합 문자열을 가져온다.
Namespace: Pixoneer.NXDL.NIOAssembly: NXDLio (in NXDLio.dll) Version: 2.0.3.38
Syntaxpublic string[] GetSubDatasets(
string strFileName
)
Parameters
- strFileName String
- [In] 파일 경로
Return Value
String 하위 데이터 집합(SubDataset) 문자열 배열
Example
아래는 파일의 하위 데이터 집합이 있는 경우 하위 데이터 집합 문자열을 가져와서
각 하위 데이터 별로 영상을 로딩하는 예제이다.
XLD 파일은 각 하위 데이터 별로 생성되며 XRSLoadFile의 FilePath에는 [파일경로+하위 데이터 구분 문자열]이 저장된다.
예1: Sentinel-1 파일일 경우 : XRSLoadFile.FlePath => *.safe:SUBDATASET0 ~ *.safe:SUBDATASETn
예2: K5 위성영상일 경우 : XRSLoadFile.FlePath => *.h5:S01:SUBDATASET0 ~ *.h5:Snn:SUBDATASETnn
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)
{
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);
}
See Also