XDL TIP
[NCC] 좌표계 변환 ( Geographic->UTM 변환)
작성자관리자 작성일2016-11-19 조회수5,986
<em> // Geographic 좌표 시스템으로부터 UTM 좌표시스템으로 변환 수행(예제는 UTM Zone 52, Northern hemisphere로의 변환)</em>
<em> // 1. XSpatialReference을 생성하여 Geographic좌표 시스템 설정</em>
XSpatialReference srIn = new XSpatialReference();
srIn.SetWellKnownGeogCS("WGS84");
<em> // 2. XSpatialReference을 생성하여 UTM 좌표 시스템 설정</em>
XSpatialReference srOut = new XSpatialReference();
srOut.SetWellKnownGeogCS("WGS84");
srOut.SetUTM(52, true);
<em> // 3. XCoordinateTransformation 객체를 생성하여 Geographic 좌표 시스템으로부터 UTM 좌표시스템으로 변환시스템을 생성</em>
XCoordinateTransformation coordTrans = new XCoordinateTransformation();
if (!coordTrans.CreateCoordinateTransform(ref srIn, ref srOut)) return;
<em> // 4. 좌표값 변환 수행</em>
double xOut, yOut;
xOut = yOut = 0;
coordTrans.TransformPt(127.0, 36.0, ref xOut, ref yOut);
<em> // 1. XSpatialReference을 생성하여 Geographic좌표 시스템 설정</em>
XSpatialReference srIn = new XSpatialReference();
srIn.SetWellKnownGeogCS("WGS84");
<em> // 2. XSpatialReference을 생성하여 UTM 좌표 시스템 설정</em>
XSpatialReference srOut = new XSpatialReference();
srOut.SetWellKnownGeogCS("WGS84");
srOut.SetUTM(52, true);
<em> // 3. XCoordinateTransformation 객체를 생성하여 Geographic 좌표 시스템으로부터 UTM 좌표시스템으로 변환시스템을 생성</em>
XCoordinateTransformation coordTrans = new XCoordinateTransformation();
if (!coordTrans.CreateCoordinateTransform(ref srIn, ref srOut)) return;
<em> // 4. 좌표값 변환 수행</em>
double xOut, yOut;
xOut = yOut = 0;
coordTrans.TransformPt(127.0, 36.0, ref xOut, ref yOut);