[R-sig-Geo] raster::writeRaster access violation
Oliver Soong
osoong+r at gmail.com
Sun Dec 2 21:36:36 CET 2012
Hi,
I'm getting occasional crashes writing out GeoTIFFs. For reference,
this is on Windows 7 32-bit, R 2.15.2 (x86), rgdal 0.7.22, and raster
2.0.31. Windows is reporting an access violation from msvcrt.dll.
When the crash occurs, there is a temporary file in tempdir() and the
correctly written output file in the correct location. It might
possibly be related to an earlier problem with GDAL.close, which Roger
so kindly fixed a few months back. That thread is quoted below.
I have not been able to pin down a specific trigger or test case. I'm
processing a number of rasters, and the error occurs on different
rasters each time I run things. Suggestions on workarounds and how to
isolate the fault are welcome.
Oliver
On Fri, Sep 21, 2012 at 11:42 AM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> 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