2. 실습순서
• VWORLD 키 획득
• VWORLD API 연동 클래스 설명
• 주소에서 위경도 가져오기 실습
• 위경도 에서 주소 가져오기 실습
• 구글 에서 고도 값 가져오기 실습
• proj4.net 과 geoapi .net dll을 이용하여 TM좌표로 변환 실습
3. VWORLD KEY 획득
- 회원가입 후 로그인해서 사용자정보 등 등록.
- URL을 등록하고 ,인증키를 받음
- 키를 붙임
5. Vworld API 연동 클래스 설명
.vworldrefer.cs
public XmlDocument GetVWorldData(string qUrl): VWorld의 지도 및 데이터 레퍼런스 API를 이용해서 원하는 값을
Xml형식으로 반환
public LonLat JibunToLonLat(string Jibun): 지번을 좌표로 변환
public LonLat DoRoToLonLat(string DoRo): 도로명 주소를 좌표로 변환
public List<string> GetJiBunAddr(string Lat, string Lon): 경위도를 지번으로 변환
public List<string> GetDoRoNameAddr(string Lat, string Lon): 경위도로 도로명 변환
public double getElevation(double latitude, double longitude): 경위도로 구글 고도 값 가져오기
*.Struct.cs 데이터구조
public class LonLat
{
public LonLat()
{
Lat = 0;
Lon = 0;
}
public LonLat(double Lat, double Lon)
{
this.Lat = Lat;
this.Lon = Lon;
}
public double Lat { get; set; }
public double Lon { get; set; }
public string LAT { get; set; }
}
6. 1. 주소를 좌표로 변환하기
public void jusocoord(string juso, string type)
{
LonLat ll4326 = new LonLat();
if( type.Equals("jibun")){
ll4326 = vworld.JibunToLonLat(juso);
}
if (type.Equals("newaddr"))
{
ll4326 = vworld.DoRoToLonLat(juso);
}
txt_lat.Text = ll4326.Lat.ToString();
txt_lon.Text = ll4326.Lon.ToString();
//return coordinate;
}