Skip to content
Prev 8674 / 29559 Next

polygonValues (raster): Very slow

Dear Agus,

You are extracting values for 18000 polygons for a high res raster.
That is going to take a while. And using "weights=TRUE" is also bad
(in terms of processing speed!); do you really need it?. You can do
some testing by subsetting the polygons object.

If the polygons are not overlapping, you could consider to do
polygonsToRaster and then zonal. That would likely be much faster (but
you would not have the weights).

I have not attempted to optimize polygonValues much and 'raster' does
not do multi-processor computations. I hope to have that implemented,
at least for some slower functions like this one, by the end of this
year.

Robert
On Wed, Jun 30, 2010 at 7:12 AM, Agustin Lobo <alobolistas at gmail.com> wrote: