Hi Tom, List members,

Thanks for the reply. My polygons constitute a tiling of 100m or 200m
square polygons, with no overlaps. I'll be trying to make predictions for
the smaller scale, but some of my input variables like Climate are at
coarser (800m) resolution, so I'm trying to combine these data into the
vector dataset of polygons.

Also, in case it matters, the polygons are along the paths of streams.
Essentially I rasterized a stream dataset, and then converted that into a
grid of (vector) polygons for my analyses. I'm in the process of getting
all of the data I need into the attribute table...

I've been using SAGA GIS some of this prep work, and they have a tool for
"Grid Statistics for Polygons." That worked fine for getting data from
fine-grain (10m pixels) rasters to my polygons, but I'm having trouble
getting the coarse-grain layers in.

I'm open to using other tools as well, but was hoping to figure out a good
way to batch this processing.

Thanks again!
Mike






On Fri, Aug 30, 2013 at 1:44 PM, Tom Philippi <tephilippi@gmail.com> wrote:

> Mike--
> Do your 96000 polygons overlap (e.g., species ranges for 96k species), or
> do they constitute a tiling with tiny polygons relative to the raster cell
> size (e.g., a vegetation map v. coarse raster climate data)?  Also, roughly
> how many vertices do your polygons have?
>
> I suspect that there isn't a single most efficient way to do large
> extractions from rasters: extract() is a good general tool, but
> alternatives can be much faster for specific cases..
> With more information, folks on the list might be able to suggest specific
> solutions.
>
>
> Tom
>
>
>
> On Fri, Aug 30, 2013 at 10:13 AM, Michael Treglia <mtreglia@gmail.com>wrote:
>
>> Hi All,
>>
>> I've been trying to use the extract function (in the raster packages) to
>> get values of a raster entered as attributes of series of polygons, and
>> have tested it successfully with a reduced dataset, but am concerned that
>> my full dataset might be too big.
>>
>> My full datasets involve ~46000 and 96000 polygons. My raster is not that
>> big though - 171x191 pixels. So far I've tried running this on the 46000
>> polygon file, and I'm running it now, but it has gone for >1 hour...
>> should
>> I just expect it to take a few hours?
>>
>> I'm running extract with fun="mean" and weights=TRUE in case that is
>> useful.
>>
>> I'm running R 3.0.1 on Win7 (64 bit for both), 12GB ram, and though one
>> processor thread seems to be pretty maxed out, I've got plenty of memory.
>>
>> I'll have to do this with about 39 rasters, so I was hoping that grouping
>> them as stacks for this function would allow me to run this process as a
>> batch, but if it is taking a few hours per raster with the "small" set of
>> polygons, it might not be feasible.
>>
>> Any thoughts?
>>
>> Thanks!
>> Mike
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>

	[[alternative HTML version deleted]]

