Bom dia pessoal.
Estou baixando uns arquivos raster (pelo R) e gostaria de salva-los em uma pasta para posteriormente usá-los.
O problema é que para um formato de arquivo e site eu estou conseguindo (Exemplo 1 no código abaixo), entretanto, para o outro conjunto eu não consigo ler os arquivos de jeito nenhum.
Qualquer ajuda sera super bem vinda..
##Inicio: Exemplo 1
require(raster)
file1<-'srtm_03_08'##Tamanho do arquivo: 395k
utils::download.file(url1,destfile=paste(file1,".zip",sep=""),mode='b',method='wget')
r1<-raster::raster(unzip(paste(file1,".zip",sep=""),paste(file1,".asc",sep="")))
r1
##Fim: Exemplo 1
##Aqui está o problema
##Tentativa 1
file2<-'SRTM_fB01_n000w177'##Tamanho do arquivo: 66k
utils::download.file(url2,destfile=paste(file2,".zip",sep=""),mode='b',method='wget')
r2<-raster::raster(unzip(paste(file2,".zip",sep=""),paste(file2,".tif",sep="")))
zip.file.extract(paste(file2,".zip",sep=""),paste(file2,".tif",sep=""))
##Tentativa 2
temp<-tempfile()
utils::download.file(url2,destfile=temp,mode='b',method='wget')
raster::raster(temp)
raster(paste(temp,'/',file2,".tif",sep=""))
###Informações do OS
sysname release
"Linux" "3.2.0-39-generic-pae"
version nodename
"#62-Ubuntu SMP Wed Feb 27 22:25:11 UTC 2013" "aa"
machine login
"i686" "unknown"
user effective_user
"aa" "aa"
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu precise (12.04.5 LTS)
locale:
[1] LC_CTYPE=pt_BR.UTF-8 LC_NUMERIC=C LC_TIME=pt_BR.UTF-8 LC_COLLATE=pt_BR.UTF-8
[5] LC_MONETARY=pt_BR.UTF-8 LC_MESSAGES=pt_BR.UTF-8 LC_PAPER=pt_BR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-6 rgdal_0.9-2 raster_2.2-31 sp_1.0-15 downloader_0.3
loaded via a namespace (and not attached):
[1] digest_0.6.4 grid_3.1.3 lattice_0.20-30 tools_3.1.3