What is the cause for the degradation of environment?
Capitalism, corruption, consuming society? - OVERPOPULATION!
Please, save the Planet - kill yourself...

Monday, August 13, 2012

Rgdal Package: R crash during "writeGDAL" solved

Lost entire day fighting this ridicules crash during export of raster created in R to GeoTiff (other "rgdal" functions worked fine). This option worked well several months ago when I last time used it, so I wondered what happened. I searched for the only error message I was able to catch: "Failure during IO", but wasn't able to find anything useful. 

After some time I started to suspect GDAL itself in abnormal behaviour since its latest updates caused some troubles already. I was wrong but the idea itself turned to be useful - I recalled that I had about a dozen of GDAL updates since "rgdal" package was installed. Despite the package was "up to date" I've reinstalled it. It solved the problem)))


  1. You may not have heard of him, but a famous (here in the USofA anyway) fiction and non-fiction writer, Paul Theroux, gave a talk a while back which was shown on bookTV. His closing remark: "stop having so many kids".

  2. I've added a sanity check between the version declared in gdal_version.h recorded when rgdal was installed and the version declared by the runtime. This will (I hope) detect say an rgdal installed using 1.9.0 and loading the GDAL 1.9.1 shared object, issuing a startup message mentioning the discrepancy. Please try it from R-Forge, revision 352, and let me know whether it works, and/or post to R-sig-geo to confirm. Of course, this cannot trap different SVN revisions in GDAL, and I'd welcome insight into how that might be done - I don't see where GDAL might declare the relevant r##### in a header.