Hello, 

You can use either as.imageSpatialGridDataFrame(x[1]) or as.matrix(x[1]), 
where "x" is a SpatialGridDataFrame or SpatialPixelsDataFrame.

The "1" index assumes you want the first band, replace as appropriate. 

The first gives you a list with x, y, z components in the convention
expected by image(), so
as.imageSpatialGridDataFrame(x[1])$z is the matrix. 

The second returns the matrix directly but in a different orientation. 

HTH

Regards, Mike. 


==============Original message text===============
On Fri, 23 Jan 2009 8:59:02 +1100 Jonathan Greenberg wrote:

I was hoping I could get some info on how to coerce the type of object 
readGDAL produces, assuming its a multiband object, into an R matrix (I 
just want the raster values in the matrix)?  Thanks!

--j

-- 

Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

===========End of original message text===========



If it wasn't backed-up, then it wasn't important. ~ Anon sysadmin

Mike Sumner (Phd. Candidate)
http://www.antcrc.utas.edu.au/~mdsumner/ http://www.zoo.utas.edu.au/awru/  IASOS/AWRU
University of Tasmania
Private Bag 80
Hobart Tasmania 7001
AUSTRALIA
Email: mdsumner@utas.edu.au 
Phone: 03 6226 1752 (W)
       0408599921   (M)
Fax:   03 6226 2745


