[R-sig-Geo] Subsetting a spatial grid

rick reeves reeves at nceas.ucsb.edu
Wed Dec 10 19:35:25 CET 2008


The following R example might be a bit off-topic, but it does show how 
to create a point grid
and then use it to extract samples from an underlying set of vector 
polygons. The vector polygon
data could probably be replaced by a raster grid. Though not a very big 
one, given R's memory
limitations.

http://www.nceas.ucsb.edu/scicomp/GISSeminar/UseCases/SampleVectorPolygonsRasterGrid/SampleVectorPolysRastGrid.html

I might suggest the use of GRASS for this task.

Rick Reeves

Dylan Beaudette wrote:
> On Wednesday 10 December 2008, Rob Robinson wrote:
>   
>> Help - please! :-)
>>  I have what I thought was a really simple problem. I have a raster image
>> of satellite data from which I would like to extract an arbitrary (but
>> simple rectangular) portion for subsequent analysis (which I'll need to do
>> for many images). I have the data as a (projected) SpatialGridDataFrame and
>> have tried two approaches: create a SpatialPolygon and overlay it (but I
>> don't think overlay does what I would like it to do), or access the coords
>> slot of the data set and pick those within the range. I haven't been able
>> to get either to work - presumably because my R is not good enough! It
>> seems a fairly common task, but I haven't yet stumbled across an FAQ or
>> page in ASDAR which seems to help. Any pointers anyone?
>> Many thanks for any help
>> Cheers
>> rob
>>     
>
> Not sure how to do this in R, but gdal_translate can do this for you on the 
> command line. you will need a working GDAL install.
>
> Cheers,
>
> Dylan
>
>   
>> *** Want to know about Britain's birds? Try  www.bto.org/birdfacts ***
>>
>> Dr Rob Robinson, Senior Population Biologist
>> British Trust for Ornithology, The Nunnery, Thetford, Norfolk, IP24 2PU
>> Ph: +44 (0)1842 750050        E: rob.robinson at bto.org
>> Fx: +44 (0)1842 750030        W: www.bto.org/cv/rob_robinson.htm
>>
>> ==== "How can anyone be enlightened, when truth is so poorly lit" =====
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>     
>
>
>
>   


-- 
Rick Reeves
Scientific Programmer/Analyst and Data Manager
National Center for Ecological Analysis and Synthesis
UC Santa Barbara
www.nceas.ucsb.edu
805 892 2533




More information about the R-sig-Geo mailing list