![]() |
XDMBand
|
public class XDMBandResize : XDMBand
The XDMBandResize type exposes the following members.
Name | Description | |
---|---|---|
![]() | XDMBandResize | XDMBandResize 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. |
Name | Description | |
---|---|---|
![]() | GetInputParam | Resize를 위한 입력 파라미터를 반환한다. |
![]() | SetInputParam | Resize를 위한 입력 파라미터를 설정한다. |
보통 2장 이상의 영상으로 작업을 하려는 경우 센서의 종류가 다르거나 이미지 종류가 다르다면 동일한 해상도로 수정해 주어야 할 필요가 있다. 특히 DEM의 경우가 그러하며 동일한 해상도로 수정할 때 사용된다.
Pixel Size는 공간 해상도 단위에 따르는데, 좌표계에 맞는 적절한 값을 입력해야 한다.
만일 Sub 영역이 입력된 Band의 범위를 벗어나는 경우 존재하지 않은 화소들에 대해 지정된 Blank Value로 채우게 된다.
using Pixoneer.NXDL; using Pixoneer.NXDL.NRS; using Pixoneer.NXDL.NIO; // IO initialize to load image file XRasterIO RasterIO = new XRasterIO(); String strError = ""; if (RasterIO.Initialize(out strError) == false) { return; } // Image load String strFilePathLoad = "D:\\Sample\\IKONOS.xdm"; XRSLoadFile xrsFileInput = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg); // Set input param XBandParamResize InputParam = new XBandParamResize(); InputParam.SrcBand = xrsFileInput.GetBandAt(0); InputParam.ptLL.X = 100; // Pixel Coord InputParam.ptUR.X = 300; // Pixel Coord InputParam.ptLL.Y = 100; // Pixel Coord InputParam.ptUR.Y = 300; // Pixel Coord InputParam.PixelSizeX = 2.0; // Meter InputParam.PixelSizeY = 2.0; // Meter InputParam.ResampleMethod = eResampleMethod.BiLinear; // Set resample method // Create new process band and set input param XDMBandResize bandProcess = new XDMBandResize(); if (!bandProcess.SetInputParam(ref InputParam)) { return; } // Create XRSSaveFile to save real time band(XDMBandXXXX). // Load another file to protect thread lock(it is stable and faster). XRSLoadFile fileLoad = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg); XRSSaveFile fileSave = new XRSSaveFile(); for(int i=0; i < fileLoad.NumBand; i++) { XDMBand bandRaw = fileLoad.GetBandAt(i); XBandParamResize param = new XBandParamResize(ref InputParam); param.SrcBand = bandRaw; XDMBandResize bandTmp = new XDMBandResize(); bandTmp.BandName = bandRaw.BandName; bandTmp.SetInputParam(ref param); XDMBand bandCast = (XDMBand)bandTmp; fileSave.AddBand(ref bandCast); } // Save resized file XThread thd = null; String strFilePathSave = "D:\\Sample\\Out_Resize.xdm"; if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd)) { return ; }