我正在讀取R中的.tif文件並獲取下面列出的4條警告消息。當我按照第4條消息的指示時,前3個警告仍然保留,但從文件中讀取的值在每個像素處劇烈變化。請幫助我從.tif文件正確讀取數據。示例文件可以在鏈接上找到:ftp://ftp.ntsg.umt.edu/pub/MODIS/NTSG_Products/MOD16/MOD16A2_MONTHLY.MERRA_GMAO_1kmALB/GEOTIFF_0.05degree/讀取R中的.tif文件
我的代碼:
remove(list=ls())
library(tiff)
library(raster)
str_name<-'MOD16A2_ET_0.05deg_GEO_2008M01.tif'
read_file<-readTIFF(str_name)
警告信息:
1: In readTIFF(str_name) :
TIFFReadDirectory: Unknown field with tag 33550 (0x830e) encountered
2: In readTIFF(str_name) :
TIFFReadDirectory: Unknown field with tag 33922 (0x8482) encountered
3: In readTIFF(str_name) :
TIFFReadDirectory: Unknown field with tag 34735 (0x87af) encountered
4: In readTIFF(str_name) :
tiff package currently only supports unsigned integer or float sample formats in direct mode, but the image contains signed integer format - it will be treated as unsigned (use native=TRUE or convert=TRUE to avoid this issue)
請幫我正確讀取TIF文件這個問題。提前致謝。
嗨,我使用了命令,但得到以下錯誤消息:錯誤.rasterObjectFromFile(x,band = band,objecttype =「RasterLayer」,: 無法從此文件創建RasterLayer對象;也許您需要首先安裝rgdal – Munish
我的R版本是:2.15.2,如果這有助於解決問題,當我加載光柵包時,它給了我警告消息:加載所需包:sp 警告消息: 1:包'光柵'是在R 2.15.3 2:package'sp'是在R 2.15.3版本下構建的 – Munish
也許你需要先安裝rgdal – mdsumner