Alexsandro Cândido de Oliveira Silva
2014-Jun-03 11:42 UTC
[R] Change the raster data extent
Hi, I’m trying to check if several raster data stored in temp.data have the same extent of target raster. I guarantee that all data in temp.data overlap the target and they have the same resolution and crs. The conditional test is ok, because the “OK! ” is printed. But the algorithm return: Erro em compareRaster(x) : different extent Please, anyone could help me!? Thanks for ( i in 1:n) { temp.data [ i ] <- raster(Tiff.files.list [ i ]) if(!(compareRaster(temp.data[[ i ]], target,extent=T,rowcol=F,crs=F,res=F,orig=F,rotation=F,values=F,stopiffalseF,showwarning=F))) { cat("\nOK!\n") target.extent <- extent(target) temp.data [[ i ]]<-extend(temp.data[[ i ]],target.extent) temp.data [[ i ]]<-crop(temp.data[[ i ]],target.extent) } } data<-stack(temp.data) Att. Alexsandro Cândido de Oliveira Silva ____________________________________________________________________________ _______ --- Este email está limpo de vírus e malwares porque a proteção do avast! Antivírus está ativa. http://www.avast.com [[alternative HTML version deleted]]