XDL TIP
[XDL2.0] 256 x 256 타일 형식의 TIFF 파일로 저장하기
작성자
pixoneer support
작성일
2021-01-07 19:52
조회
1243
// 1. XRasterIO객체를 생성하고 초기화를 수행.
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
return;
}
// 2. XRasterIO객체에 파일 경로를 입력하여 XRSLoadFile를 생성
XRSLoadFile xrsFileInput = RasterIO.LoadFile("d:test.xdm", out strError, false, eIOCreateXLDMode.None);
if (xrsFileInput == null) return;
// 3. XRSLoadFile객체에 들어 있는 XDMBand를 꺼내어 XRSSaveFile객체에 추가
XRSSaveFile fileSave = new XRSSaveFile();
for (int i = 0; i < xrsFileInput.NumBand; i++)
{
XDMBand band = (XDMBand)xrsFileInput.GetBandAt(i);
if (band == null) continue;
fileSave.AddBand(ref band);
}
// 4. XRSFileSave의 MetaData에 생성 옵션 설정
// 아래의 생성 옵션은 GDAL의 Raster Driver에서 각 출력 형식의 "Create Options" 참고
XRSMetaData metaData = new XRSMetaData();
metaData.SetValue("TILED", "YES");
metaData.SetValue("BLOCKXSIZE", "256");
metaData.SetValue("BLOCKYSIZE", "256");
fileSave.MetaData = metaData;
String strFilePathSave = @"d:output.tif";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "GTiff", out strError, null))
{
MessageBox.Show("Fail!!!!");
}
else
{
MessageBox.Show("End");
}
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
return;
}
// 2. XRasterIO객체에 파일 경로를 입력하여 XRSLoadFile를 생성
XRSLoadFile xrsFileInput = RasterIO.LoadFile("d:test.xdm", out strError, false, eIOCreateXLDMode.None);
if (xrsFileInput == null) return;
// 3. XRSLoadFile객체에 들어 있는 XDMBand를 꺼내어 XRSSaveFile객체에 추가
XRSSaveFile fileSave = new XRSSaveFile();
for (int i = 0; i < xrsFileInput.NumBand; i++)
{
XDMBand band = (XDMBand)xrsFileInput.GetBandAt(i);
if (band == null) continue;
fileSave.AddBand(ref band);
}
// 4. XRSFileSave의 MetaData에 생성 옵션 설정
// 아래의 생성 옵션은 GDAL의 Raster Driver에서 각 출력 형식의 "Create Options" 참고
XRSMetaData metaData = new XRSMetaData();
metaData.SetValue("TILED", "YES");
metaData.SetValue("BLOCKXSIZE", "256");
metaData.SetValue("BLOCKYSIZE", "256");
fileSave.MetaData = metaData;
String strFilePathSave = @"d:output.tif";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "GTiff", out strError, null))
{
MessageBox.Show("Fail!!!!");
}
else
{
MessageBox.Show("End");
}
전체 0개
번호 | 제목 | 작성자 | 작성일 | 조회 |
7 |
[NXDL] XGeoPoint클래스 사용하기
pixoneer
2016.11.19
3326
|
pixoneer | 2016.11.19 | 3326 |
6 |
[NXDL] XColorTable사용하기
pixoneer
2016.11.19
1650
|
pixoneer | 2016.11.19 | 1650 |
5 |
[NXDL] XGrid클래스 사용하기
pixoneer
2016.11.18
1875
|
pixoneer | 2016.11.18 | 1875 |
4 |
[NXDL] XVertex2i 클래스 사용하기
pixoneer_THK
2016.11.18
1597
|
pixoneer_THK | 2016.11.18 | 1597 |
3 |
[NXDL] XVertex3d클래스 사용하기
pixoneer_THK
2016.11.18
1602
|
pixoneer_THK | 2016.11.18 | 1602 |
2 |
[NXDL] XVertex2d 클래스 사용하기
pixoneer_THK
2016.11.18
1602
|
pixoneer_THK | 2016.11.18 | 1602 |
1 |
[NXDL] XAngle클래스 사용하기
pixoneer_THK
2016.11.18
1635
|
pixoneer_THK | 2016.11.18 | 1635 |