[R-sig-Geo] memory issue on R with Linux 64
Roger Bivand
Roger.Bivand at nhh.no
Thu Jan 29 08:09:35 CET 2009
On Thu, 29 Jan 2009, Alexander.Herr at csiro.au wrote:
>
> Hi List,
>
> I get an error using readGDAL{rgdal}: cannot allocate vector of size 3.1
> Gb
This is a tile of your 73K by 80K raster, right? One possibility is to use
smaller tiles, another to get more memory (as Edzer wrote), a third to use
lower level functions in rgdal to avoid duplication (and repeated gc()) -
in readGDAL the data read by getRasterData() are copied, so at least
doubling memory usage.
Do you need to read the raster? If this is the overlay problem, you should
be able to use the output of GDALinfo for your raster to build a
GridTopology and SpatialGrid, and overlay (tiles of) that on the
SpatialPolygons (tiles of that because overlay() will generate cell centre
coordinates and do point in polygon, so you're still stuck with too many
coordinates). The next issue would be to copy out the polygon IDs, or the
extracted values, as a raster - here the forthcoming raster package on
R-Forge may be what you need.
Roger
>
> I am using Linux 64bit (opensuse 11) with 4 gig swap and 4 gig Ram and R
> 2.8.0.
>
> The load monitor shows that most of Ram is used up and then when Swap
> use starts increasing, R returns the error.
>
> Is there anything I should do within R to circumvent this?
>
>
> Any help appreciated
> Thanks
> Herry
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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