map algebra with ascii grid
Any algebraic operation supported by R can easily be applied to a GDAL image using rgdal -- size is virtually unlimited if you pull in data as raster lines or tiles. The approach is to create an output image and then use getRasterData and putRasterData to read chunks of data, operate on them, and then write back to disk. I can work up an example if anyone is interested. THK
On 7/16/07, Denham Robert <Robert.Denham at nrw.qld.gov.au> wrote:
Philip,
this sounds like an interesting approach. Do you do anything in
particular to handle larger datasets? How large are your images?
Robert Denham
Environmental Statistician
Remote Sensing Centre
Telephone 07 3896 9899
www.nrw.qld.gov.au
Department of Natural Resources & Water
QScape Building, 80 Meiers Road, Indooroopilly Qld 4068
----------------------------------------------------------------------
Message: 1
Date: Sun, 15 Jul 2007 07:40:12 -0600
From: Philip Riggs <priggs at cnr.colostate.edu>
Subject: [R-sig-Geo] map algebra with ascii grid
To: r-sig-geo at stat.math.ethz.ch
Message-ID: <3513F1E2-D6E1-4B2B-89E8-D0B00C2804B7 at cnr.colostate.edu>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Dear R Users, could you please advise me on doing map algebra with spatial grids? It's the first time I am using spatial objects in R. I have imported an ascii grid file and wanted to round the values in it or sum with a
value, but it gives an error message:
I use Python with Numpy/GDAL python bindings all the time to do spatial
algebra and manipulate grids.
It has all the math functions, and in the case of categorical data you
can reassign values. Then I
use rpy to do any statistical analyses in R. You could also do your
manipulation in Python, then
save the grid in an appropriate format for import into R to do the
statistical analyses.
Philip
************************************************************************ The information in this email together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this email message is prohibited, unless as a necessary part of Departmental business. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network.
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Timothy H. Keitt, University of Texas at Austin Contact info and schedule at http://www.keittlab.org/tkeitt/ Reprints at http://www.keittlab.org/tkeitt/papers/ ODF attachment? See http://www.openoffice.org/