|
XDMBandMath Class
|
XDMBandMath 클래스는 사용자가 정의하는 연산식을 이용하여 영상 밴드 간의 래스터 연산을 수행한다.
Inheritance Hierarchy
Namespace: Pixoneer.NXDL.NRSAssembly: NXDLrs (in NXDLrs.dll) Version: 2.0.3.38
Syntaxpublic class XDMBandMath : XDMBand
The XDMBandMath type exposes the following members.
Constructors | Name | Description |
---|
 | XDMBandMath | XDMBandMath 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. |
Top
Methods
Remarks
영상 밴드는 추가한 순서대로 "B" 접두사를 붙여서 구분한다. 예를 들어 두 번째 영상 밴드는 "B2"로 수식에 사용하면 된다.
수식에 사용할 수 있는 토큰은 다음과 같다.
- 숫자 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- 연산자 : +, - *, /, <, >, <=, >=, ==, !=, ^
- 함수 : sin, cos, tan, asin, acos, atan, exp, ln, log, sqrt, pow, inv
Example
XBandParamMath의 ArrBandList에 추가한 밴드 중 첫번째 밴드(B1)의 화소값이 50보다 크면 0으로, 그렇지 않으면 B1 화소값을 반환하는 XDMBandMath 밴드를 생성하고 이를 파일로 저장하는 예제이다.
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
return;
}
String strFilePathLoad = "D:\\Sample\\RS_Sample\\Math\\etm.xdm";
XRSLoadFile xrsFileInput = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);
XBandParamMath InputParam = new XBandParamMath();
for (int i = 0; i < xrsFileInput.NumBand; i++)
{
InputParam.ArrBandList.Add(xrsFileInput.GetBandAt(i));
}
InputParam.ExpressionIF = "B1 > 50";
InputParam.ExpressionELSE = "0";
InputParam.ExpressionTHEN = "B1";
XDMBandMath bandProcess = new XDMBandMath();
bandProcess.BandName = xrsFileInput.FileName;
bandProcess.SetInputParam(ref InputParam);
XRSSaveFile fileSave = new XRSSaveFile();
XDMBand bandCast = (XDMBand)bandProcess;
fileSave.AddBand(ref bandCast);
XThread thd = null;
String strFilePathSave = "D:\\Sample\\Out_Math.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
return;
}
See Also