[R-sig-Geo] Properly closing GDAL datasets

Christopher Swingley cswingle at swingleydev.com
Sat Aug 9 22:50:50 CEST 2014


Roger,

On Sat, Aug 9, 2014 at 11:25 AM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> You need to provide full information from sessionInfo() such as platform and
> rgdal version, the messages displayed when rgdal is loaded, and how you
> installed GDAL. The answer will depend on these, not least because recent
> rgdal versions clean up better than earlier versions.

Sorry about that.  I figured it was something more general I was doing
incorrectly.  Based on your suggestion, I upgraded rgdal to the latest
version (0.8-16), and I'm not seeing extra file descriptors, which
makes me think that this has solved the problem.

Does that mean my method of reading, overwriting and writing is an
acceptable method for what I'm trying to do, which is write a new
raster with all the same parameters but new data?

For reference, here's my old environment, where I had the problem.

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

> library(rgdal)
Loading required package: sp
rgdal: version: 0.8-11, (SVN revision 479M)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.7.3, released 2010/11/10
Path to GDAL shared files: /usr/share/gdal/1.7
GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 470]
Path to PROJ.4 shared files: (autodetected)

The server has GDAL 1.11.0 and 1.9.1 installed in /usr/local, in
addition to 1.7.3, which is the system-level Ubuntu package that is
installed, and which appears to be what rgdal linked against.  I might
see some benefit to linking against a newer version, I expect.

Thanks,

Chris
-- 
Christopher Swingley
Fairbanks, Alaska
http://swingleydev.com/
cswingle at swingleydev.com



More information about the R-sig-Geo mailing list