Re: [R] [R-sig-Geo] clipping a large image on R

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Fri, 11 Jan 2008 18:47:23 +0100 (CET)

On Fri, 11 Jan 2008, Henrik Bengtsson wrote:

> 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.

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

>
> /HB
>
> On 11/01/2008, Milton Cezar Ribeiro <milton_ruser@yahoo.com.br> wrote:
>> Dear all,
>>
>> I have a so large image (43,000 x 18,000 pixels) and I need clip this
>> image with a smallest one (1000x1000 pixels). I can read the second
>> image using rgdal package. But the first image canīt be read on my
>> system because if memory limitation (I have about 2GB availabe).
>>
>> So I would like hear from you if anyone have some suggestin in this regards. I have also ArcGis 8.6 ans Erdas 8.3 running on my system and I can read the largest file without problem. But I dont know how clip the large image to keep only those pixels that math to he smallest image coordinates.
>>
>> kind regards, miltinho
>>
>>
>>
>> para armazenamento!
>>
>> [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo_at_stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand_at_nhh.no

______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Fri 11 Jan 2008 - 17:51:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Jan 2008 - 18:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive