[R-sig-Geo] creating point sample of polygons using spsample

2014-03-13 Thread Spencer Meyer
Greetings - I am using R 2.15.2 on Windows 7 and am seeking help with the spsample function in R. I have a polygon dataset (n= 5733) and I'm trying to use the spsample function to sample the polygons to create a point dataset. I'm using sapply to create the sample based on code I found here: http:

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Jonathan Greenberg
Sorry for the barrage of emails, but here is a more relevant example with two parallel solutions: install.packages("spatial.tools", repos="http://R-Forge.R-project.org",type="source";) library(spatial.tools) # The function passed to rasterEngine does the looping via lapply: classID_rasterEngine_f

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Jonathan Greenberg
There is typically a diminishing returns with larger and larger "chunks", but there is a low-end in terms of file size and chunk size for how much parallel processing helps. However, if you are only reading and writing once, I don't see too much of an advantage of loading everything into memory on

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Boulanger, Yan
Is it so that system.time in this case can strongly depend on how much data is placed in RAM? In my case, I'm far from being memory limited (RAM = 192 Gb) and most of the time, it's faster to put everything in memory and then process it. The major limiting speed factor here is I/O. yan Yan Bou

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Boulanger, Yan
Many thanks Jonathan, Alex and Forrest, This is very helpful information. I'll see what's the best between calc and rasterEngine. Sincerely, Yan Yan Boulanger, Chercheur scientifique / Research scientist Ressources Naturelles Canada, Canadian Forest Service Centre de Foresterie des Laurenti

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Jonathan Greenberg
Yan: Looks like you are getting great help with this -- I want to echo Alex's note that rasterEngine is not a catchall -- for REALLY simple processes you'll get better performance using calc() or using LESS workers (which may seem counter intuitive). I'm submitting a paper this week that showed t

Re: [R-sig-Geo] loops in rasterEngine

2014-03-13 Thread Alex Zvoleff
On Wed, Mar 12, 2014 at 11:29 PM, Boulanger, Yan wrote: > Actually, I have several rasters of more than 440 000 000 pixels (MODIS > covering all Canada) and I have a 32-cores machine so I would like to take > advantage of it! ;-) > > Time is money (really?!!) As mentioned earlier, I would be ca