2017-02-04 8 views
0

wgs84의 투영법을 사용하여 래스터 데이터를 분석 중이며 USGS (https://lta.cr.usgs.gov/HYDRO1K)에서 다운로드 한 Hydro1k 데이터가 필요합니다. 그러나 Hydro1k는 Lambert Azimuthal Equal Area의 투영법을 특정 기원 및 기타 매개 변수와 함께 사용합니다. 그래서 미래의 분석을 위해 Hydro1k의 투영법을 WGS 84로 변환하기로 결정했습니다. 온라인에서 한 가지 방법을 시도했는데 변경된 프로젝션이 괜찮은 것 같습니다. 그러나WGS 84에 Lambert Azimuthal Equal Area로 Hydro1k 변경

#Import the selected raster after knowing name 
As.fa.1k=raster(Path.all.1k[4]) 

#Show the attribute of the input raster from README file: 
Projection used: Lambert Azimuthal Equal Area 

        Units = meters 

        Pixel Size = 1000 meters 

        Radius of Sphere of Influence = 6,370,997 meters 

        Longitude of Origin = 20 00 00E 

        Latitude of Origin = 55 00 00N 

        False Easting = 0.0 

        False Northing = 0.0 

#Custom the projection based on the origin of raster 
As.proj="+proj=laea +lon_0=100 +lat_0=45 +ellps=sphere" 

#Assign CRS to layer 
crs(As.fa.1k)=As.proj 

#Get wgs4 projection 
wgs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" 

#Assign wgs84 to raster with lambert projection 
As.wgs=projectRaster(As.fa.1k, crs=wgs) 

, 매우 이상한 것 같다 wastransformed 투사 래스터의 값 :

#values in raster before being transformed 
class  : RasterLayer 

dimensions : 8384, 9102, 76311168 (nrow, ncol, ncell) 

resolution : 1000, 1000 (x, y) 

extent  : -4462500, 4639500, -3999500, 4384500 (xmin, xmax, ymin, ymax) 

coord. ref. : +proj=laea +lon_0=-100 +lat_0=45 +ellps=sphere 

names  : na_fd 

values  : -9999, 255 (min, max) 

-9999은 값이어야한다 아래

래스터의 내가 사용하는 코드와 속성입니다 해양에서 세포의.

#values in raster after after transformed 
class  : RasterLayer 

dimensions : 1910, 5497, 10499270 (nrow, ncol, ncell) 

resolution : 0.0655, 0.04495 (x, y) 

extent  : -180.0035, 180.05, -0.5929785, 85.26152 (xmin, xmax, ymin, ymax) 

coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 

names  : na_fd 

values  : 1, 55537 (min, max) 

내가 변환 전의 래스터의 값을 추출하여, 최대 값도이다 55537. 또한 전과 변형 후의 래스터 값을 보인다는 매우 다르다.

변형되기 전에 어떻게 래스터 값을 유지할 수 있습니까?

감사합니다.

답변

0

projectRaster는 재 투영 중에 특히 투영 된 좌표계 ​​(Lambert Azimuthal)에서 지리적 좌표계 (wgs84)로 래스터 셀을 왜곡하고 값의 보간이 필요합니다.

또한 셀의 크기가 크게 다르다는 것을 알아야합니다. 아마도 projectRaster에서 '해상도 ='로 해상도를 강제 할 수 있습니까?

또한, 시도 '방법 = "NGB"'projectRaster 내부의 보간 방법은 값을 유지하기 위해 같은

+0

안녕 Sam.This 내가 원하는 정확히입니다. 매우 감사합니다. 또한 입력 래스터의 배경 데이터가 55537임을 알았습니다. 해양을 의미하며 NA로 대체되었습니다. "res ="및 "method ="arg는 매우 잘 작동합니다. 감사. –