Skip to content
Back to formatted view

Raw Message

Message-ID: <1316370914927-6806329.post@n2.nabble.com>
Date: 2011-09-18T18:35:14Z
From: Ariel Ortiz-Bobea
Subject: How to efficiently clip large grids/raster with polygons?
In-Reply-To: <CANtt_hz-XYQciu395eU0VUpgPgBKrnxwTC_NsoYZr+1GaZd2Jg@mail.gmail.com>

Thanks Robert,

It works great. It took the same time to clip the RasterStack than the
single RasterLayer. I read your "Introduction to the ?raster? package
(version 1.9-11)" and I found very useful too to understand the different
objects. Thanks for developing this resource!

I wonder about a way to combine several variables (23) and time periods
(~90,000) to efficiently do the polygon clipping on a large
RasterBrick/Stacks. I feel that I need to choose between:

1- performing the clipping on 23 RasterStacks (one for each variable, e.g.
temperature) in which each band corresponds to a time period (90,000 of
them) 

2- performing the clipping on 90,000 RasterStacks (one for each time period,
e.g. 1980/1/1 09:00) in which each band corresponds to a variable (23 of
them).

... and option 1 would be expectedly faster. But, is there a way to combine
both options to do the clipping "ALL at once" of all the time periods and
variables? I read about the "setZ" function for time-tagging layers and the
ability to perform functions for each raster cell over time... but I'm not
sure I can make use of it in this context (stacking 2 time-period layers
doubles my band number... basically, I feel it does not lead to an
additional dimension in the structure of the object).

Any thoughts would be greatly appreciated!

Regards,

Ariel



-----
Ariel Ortiz-Bobea
PhD Candidate in Agricultural & Resource Economics
University of Maryland - College Park
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/How-to-efficiently-clip-large-grids-raster-with-polygons-tp6804923p6806329.html
Sent from the R-sig-geo mailing list archive at Nabble.com.