BookmarkSubscribeRSS Feed

[지도] GINSIDE 프로시져를 활용하여서 해당 좌표의 우편번호(기초구역) 찾기

Started ‎06-15-2020 by
Modified ‎06-15-2020 by
Views 150

* 출처 : http://cafe.daum.net/statsas/3F8j/367

 

* 주소DB 다운로드 - (하단) 기초구역도(도로명주소안내시스템 개발자센터) 

  : 우편번호로 활용되는 전국 기초구역 지도

  : 기초구역도 데이터(shp 파일)를 SAS로 읽기 위하여 mapimport 프로시져 활용.

  : http://www.juso.go.kr/addrlink/addressBuildDev.do

 

* GINSIDE 프로시저는 X 와 Y 좌표들의 데이터 셋을 지도 다각형(map polygons)들을 포함하고 있는 지도 데이터 셋과 비교합니다. 프로시저는 각각의 점들의 X 와 Y 좌표들이 지도 다각형안에 들어가는지 아닌지를 정의 하게 됩니다. 만약 다각형 안에 포함 된다면, ID 변수는 그 다각형의 ID 값으로 지정합니다.

 

MAPIMPORT 프로시저는 SHP 파일들을 SAS/GRAPH 기존(traditional) 지도 데이터 세트로 처리하고, ESRI Shapefile 들을 가져올 수 있음.

 

 

 

* 응용 : 경위도 좌표로 제공되는 외부데이터의 우편번호(기초구역) 매칭;

* 출처 : http://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=grmapref&docsetTarget=p0qjcc8h...

아래의 예제를 변경하여서 경위도 좌표로 제공되는 외부 데이터를 기반으로 해당 좌표의 우편번호(기초구역)를 맵핑.

 

* 경위도 좌표로 제공되는 외부 데이터;

goptions reset=global border;

data gpscounties;

  input longitude latitude site $;

  x=longitude*arcos(-1)/180;

  x=x*(-1);

  y=latitude*arcos(-1)/180;

datalines;

-77.0348 40.0454 a

-78.4437 39.1623 b

-78.4115 39.3751 c

-78.7646 40.6354 d

;

run;

 

* mapssas.counties : 국내의 경우 행정안정부에서 제공하는 기초구역도를 활용하여서 해당 좌표의 우편번호(기초구역) 맵핑;

 

proc ginside data=gpscounties map=mapssas.counties out=gpscounties;

  id state county;

run;

 

proc sort data=gpscounties;

  by site;

run;

 

proc print data=gpscounties;

  var site state county x y;

run;

quit;

Version history
Last update:
‎06-15-2020 02:31 AM
Updated by:
Contributors

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Article Labels
Article Tags