좌표 참조 체계

R로 지리공간 데이터 시각화하기

Charlotte Wickham

Assistant Professor at Oregon State University

proj4string()

proj4string(countries_spdf)
"+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

                                                                    ↑  전 세계 데이터셋에 적합 ↑

proj4string(water)
"+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"

                                                                    ↑ 미국 데이터셋에 흔함 ↑

R로 지리공간 데이터 시각화하기

proj4string()

proj4string(nyc_tracts)
"+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
proj4string(neighborhoods)
"+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 
+lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +datum=NAD83 

+units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0"

람베르트 정각 원뿔 도법

R로 지리공간 데이터 시각화하기

CRS 설정

x <- SpatialPoints(data.frame(-123.2620, 44.5646))
x
class       : SpatialPoints 
features    : 1 
extent      : -123.262, -123.262, 44.5646, 44.5646  (xmin, xmax, ymin, ymax)
coord. ref. : NA
proj4string(x) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
x
class       : SpatialPoints 
features    : 1 
extent      : -123.262, -123.262, 44.5646, 44.5646  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
R로 지리공간 데이터 시각화하기

CRS 변환

rgdal::spTransform(x, CRSobj, ...)

spTransform(x, "+proj=lcc +lat_1=40.66666666666666         
                +lat_2=41.03333333333333 +lat_0=40.16666666666666  
                +lon_0=-74 +x_0=300000 +y_0=0 +datum=NAD83
                +units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0")
R로 지리공간 데이터 시각화하기

CRS 변환

rgdal::spTransform(x, CRSobj, ...)

spTransform(x, proj4string(neighborhoods))
class       : SpatialPoints 
features    : 1 
extent      : -11214982, -11214982, 5127323, 5127323  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=40.66666666666666    
              +lat_2=41.03333333333333 +lat_0=40.16666666666666 
              +lon_0=-74 +x_0=300000 +y_0=0 +datum=NAD83 
              +units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0 
R로 지리공간 데이터 시각화하기

연습해 봅시다!

R로 지리공간 데이터 시각화하기

Preparing Video For Download...