[R-sig-Geo] Raster reprojection in R

Víctor Rodríguez Galiano vrg@||@no @end|ng |rom gm@||@com
Sat Sep 14 11:30:00 CEST 2019


Hello,

 I am trying to reproject a raster image from sinusoidal projection using
“projectRaster”. The size of the image is not very big (922 KB), but when
applying the reprojection I get this error message: “Error: cannot allocate
vector of size 7.1 Gb”. Please see the code below:

HDFpath <- "C:/images/" # dir with images
setwd(HDFpath)            # set working directory
library(raster)
library(rgdal)
geocrs <- "+proj=longlat +ellps=WGS84 +datum=WGS84"
tile <- brick(“image.tif”)
tile_reproj <- projectRaster(tile, crs=geocrs)

Error: cannot allocate vector of size 7.1 Gb

> tile
class       : RasterStack 
dimensions  : 2400, 2400, 5760000, 1  (nrow, ncol, ncell, nlayers)
resolution  : 463.3127, 463.3127  (x, y)
extent      : -11119505, -10007555, 5559753, 6671703  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181
+b=6371007.181 +units=m +no_defs 
names       : INCA.h08v03.Dormancy_median 
min values  :                          19 
max values  :                         540 



More information about the R-sig-Geo mailing list