Click or drag to resize
XDL

XDMBandPointsToGrid Class

XDMBandPointsToGrid 클래스는 위치와 고도/화소값으로 이우러진 점좌표 데이터를 그리드 형식의 데이터로 변환한다.
LAS가 아닌 점 데이터인 경우, 텍스트 파일의 한 줄에 x, y, z(또는 화소값)으로 구성된 것으로 처리한다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NRSXDMBand
    Pixoneer.NXDL.NRSXDMBandPointsToGrid

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

The XDMBandPointsToGrid type exposes the following members.

Constructors
 NameDescription
Public methodXDMBandPointsToGrid XDMBandPointsToGrid 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
 NameDescription
Public methodGenerateOutput 입력된 점좌표 데이터들을 이용하여 출력 그리드 데이터로 변환한다.
Public methodGetInputParam 점좌표 데이터에서 그리드 형식의 데이터로 변환하는 입력 파라미터를 얻는다.
Public methodStatic memberSearchBoundInfo 입력 파일 경로의 데이터를 읽어 데이터의 공간 좌표값 중 최대값과 최소값을 계산한다.
Public methodSetInputParam 점좌표 데이터에서 그리드 형식의 데이터로 변환하기 위한 입력 파라미터를 설정한다.
Top
Example
아래의 예제는 LAS 데이터를 읽어 전체 영역을 계산한 뒤 출력크기 및 해상도 등을 설정한 후 XDM 파일로 저장하는 것이다.
C#
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 strFilePath = "D:\\Sample\\Tetons_200k.las";

// Check bounding area
double minx, maxx, miny, maxy;
minx = maxx = miny = maxy = 0;
XDMBandPointsToGrid.SearchBoundInfo(strFilePath, ref minx, ref maxx, ref miny, ref maxy, ref strError, null);

// Set input param
XBandParamPointsToGrid InputParam = new XBandParamPointsToGrid();
InputParam.arrFileList.Add(strFilePath);
InputParam.BlankValue = 0;
InputParam.BSQOut = false;
InputParam.PixelSizeX = 1;
InputParam.PixelSizeY = 1;
InputParam.DimXSize = (int)((maxx - minx) / InputParam.PixelSizeX);
InputParam.DimYSize = (int)((maxy - miny) / InputParam.PixelSizeY);
InputParam.UpperLeftX = minx;
InputParam.UpperLeftY = maxy;

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

// Generate output
XThread thd = null;
bandProcess.GenerateOutput(thd);

// create XRSSaveFile to save realtime band(XDMBandXXXX)
XRSSaveFile fileSave = new XRSSaveFile();
XDMBand bandCast = (XDMBand)bandProcess;

fileSave.AddBand(ref bandCast);

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