Skip to content

clipping a large image on R

3 messages · Milton Cezar Ribeiro, Henrik Bengtsson, Roger Bivand

#
Try the EBImage package (utilizes ImageMagick and is available via
Bioconductor.org) - not sure if it well help though.  If not, try to
clip the larger image by calling ImageMagick outside R.

/HB
On 11/01/2008, Milton Cezar Ribeiro <milton_ruser at yahoo.com.br> wrote:
#
On Fri, 11 Jan 2008, Henrik Bengtsson wrote:

            
First, please only write to one list at a time - this reply to both to 
continue thread.

Please read the documentation in the rgdal package properly, then on the 
format (unknown) that your data are in on www.gdal.org if necessary. Use 
the arguments to readGDAL() or asSGDF_GROD() in ?readGDAL, and/or 
getRasterData() or getRasterTable() in ?"GDALRasterBand-class", most 
likely offset= to offset the origin in rows and columns, and region.dim= 
to set the numbers of rows and columns to access.

You should be able to work out the ones you need from the smaller image 
that you can read. The GDALinfo() function should give you enough 
information on the larger file to help set up offset= and region.dim= - if 
resampling is needed, use output.dim= as well. If you have multiple bands, 
you can choose those too.

Roger