Click or drag to resize
XDL

XDMBandMapConv Class

XDMBandMapConv는 입력 좌표 시스템 영상에서 사용자가 정의한 좌표 시스템의 영상으로 변환한다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NRS
Assembly:  NXDLrs (in NXDLrs.dll) Version: 1.2.817.72
Syntax
C#
public class XDMBandMapConv : XDMBand

The XDMBandMapConv type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandMapConv
XDMBandImageSharpen클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
  NameDescription
Public methodGetInputParam
영상 좌표 변환을 위한 입력 파라미터를 얻는다.
Public methodSetInputParam
영상 좌표 변환을 위한 입력 파라미터를 설정한다.
Top
Remarks

입력 이미지 파일이 좌표시스템을 가지고 있는 경우에만 좌표변환이 가능하다. 입력 이미지 파일이 Not Georeference타입이거나 Unknown타입이면 변환이 불가능한다.

Examples
입력 영상을 degree 단위의 위경도 파일로 좌표변환하여 XDM 파일로 저장하는 예제이다.
using Pixoneer.NXDL;
using Pixoneer.NXDL.NRS;
using Pixoneer.NXDL.NIO;
using Pixoneer.NXDL.NCC;

// 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
XBandParamMapConv InputParam = new XBandParamMapConv();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);

InputParam.UseWCFlag = true;
InputParam.WarpMethod = eWarpMethod.Affine;
InputParam.OutSR = new XSpatialReference(); // Set output coordinate system
InputParam.OutSR.importFromEPSG(4326);        // 위경도 좌표계 설정
InputParam.PixelSizeX = 0.00001;            // degree 단위 공간 해상도 설정
InputParam.PixelSizeY = 0.00001;

InputParam.ResampleMethod = eResampleMethod.BiLinear; // Set resample method 

// Create New process band and set input param
XDMBandMapConv bandProcess = new XDMBandMapConv();
if (!bandProcess.SetInputParam(ref InputParam))
{
    return;
}

// create XRSSaveFile to save realtime 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);
    XBandParamMapConv param = new XBandParamMapConv(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandMapConv bandTmp = new XDMBandMapConv();
    bandTmp.BandName = bandRaw.BandName;
    bandTmp.SetInputParam(ref param);

    XDMBand bandCast = (XDMBand)bandTmp;

    fileSave.AddBand(ref bandCast);
}

// Save output file
XThread thd = null;
String strFilePathSave = "D:\\Sample\\Out_MapConv.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
    return;
}
See Also