[R-sig-Geo] Performance SpatialGridDataFrame to rasterStack

Johannes Radinger JRadinger at gmx.at
Fri Mar 2 12:28:10 CET 2012


Hi,

I want to use raster maps for Species Distribution Modelling (SDM) with
the package 'dismo'. Therefore I load several rastermaps (around 60) with the readRAST6 command. For further processing I want to transform them into a raster stack. Each of the raster has the same spatial extent and the same resolution (per rastermap: around 765000 cells, thereof 760000 NA's, 5000 non null cells).

The readRAST6 command to load all rasters in one step into a SpatialGridDataFrame works really good (1-2 min). The problem now is the tranformation into a stack. This takes very long time (I waited for 45 min), the CPU is mostly 100%, the pyhsical memory usage 3 GB (only a few MB left) and the virtual memory usage for R 3 GB, the HDD activity 20-30 MB/Sec data written. So my Computer seem to be at its maximum, and I don't have access to a faster/better one. I am doint all my R processes within an Eclipse workspace.

What I do:
rast <- readRAST6(rast.list, cat=(FALSE,length(rast.list)), ignore.stderr=TRUE, plugin=NULL)

rast.stack <- stack(rast)


Is there any way how I can improve the performance? As most of the raster cells are NULL cells maybe there is a special way consider that? Or splitting the SpatialGridDataFrame up and recombining the stacks in the end?
Or saving substeps to the harddisk?
Any help/suggestion is mostly welcome!

Best regards,
Johannes

-- 

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a



More information about the R-sig-Geo mailing list