[R-sig-Geo] Raster - rgdal Error: Failure during raster IO

Ben Weinstein benweinstein2010 at gmail.com
Sun Jul 5 03:24:39 CEST 2015

Hi all,

I'm getting a generic, " Error: Failure during raster IO" when trying to
crop or plot a .tif file using the raster package.

I made a markdown document showing the issue.


To summarize:

I received a orthomosiac image from a collaborator that i'm reading into R.
The file was captured using a unmanned aerial vehicle and stitched in
Agisoft Photoscan, and the resulting .tif was sent to me.

The file is quite large (~4gb on disk) and at very high resolution.

When i read in using raster, everything seems fine. The extent matches the
correct location on the earth's surface.

I’ve tried over multiple computers, reading as brick/stack/raster,
reinstalling rgdal/raster, reinstalling R and playing around with the file

Given the huge file size, i assume that this is has to do with memory (as
been suggested elsewhere with this error) - although checking out the task
manager, i see no memory spike (i have ~60gb memory) and it appears to be a
formatting error for gdal. I’ve tried reading direct with gdal, and that
fails, even when reading just a portion.

I worry that the because resolution has been labeled in reference to
latlong (Seconds?)  and is very small, and is approaching some rounding

The metadata reads in correctly.

> r

class       : RasterLayer

band        : 1  (of  4  bands)

dimensions  : 39891, 35132, 1401450612  (nrow, ncol, ncell)

resolution  : 1.83715e-07, 1.3612e-07  (x, y)

extent      : -122.9106, -122.9042, 42.41708, 42.42251  (xmin, xmax, ymin,

coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84

data source : C:\Users\Ben\Dropbox\Droning\AgisoftFull20150425_Run3.tif

names       : AgisoftFull20150425_Run3

values      : 0, 255  (min, max)

I appreciate any thoughts on the next thing to try.



Ecology and Evolution

Stony Brook University


	[[alternative HTML version deleted]]

More information about the R-sig-Geo mailing list