[R-sig-Geo] rgdal::writeGDAL temporary files

Roger Bivand Roger.Bivand at nhh.no
Fri Sep 21 20:42:02 CEST 2012


On Wed, 19 Sep 2012, Oliver Soong wrote:

> I'm processing and outputting a large number of large GeoTIFFs.  Every
> time I write one, I get a new intermediate file in tempdir().  I do
> not have enough space in my temporary folder to store all of these
> intermediates.  I believe these intermediate files back the
> GDALTransientDataset objects created by create2GDAL called from
> writeGDAL (I think), which are then copied to a data drive by
> saveDataset.  After saveDataset, though, the transient object is
> orphaned.
>
> Is it possible to tell rgdal to remove these transients after
> writing/saveDataset?  Alternatively, is it possible to tell rgdal to
> write these intermediates to a particular location?
>
> I can think of two workarounds, but I'd love to hear better ideas.  I
> could redirect R's tempdir, although this is rather inconvenient.  I
> can also try to detect the temporary files and delete them manually,
> although this is probably driver- and version-specific and so less
> robust than I would prefer.

Thanks for the report. A long time ago, there must have been an issue 
here, because a GDAL.close() - on the wrong object - was commented out. 
After checking, I've committed a fix to the rgdal R-forge project. If you 
can install rgdal from source, I'd be grateful for feedback on that; if 
you need a Windows binary, please let me know, and I'll submit the source 
package to win-builder to create one.

Roger

>
> Cheers,
> Oliver
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list