[Gdal-dev] Re: Gdal-dev Digest, Vol 42, Issue 15

Tim Keitt tkeitt at gmail.com
Fri Nov 9 21:37:37 EST 2007


Michael Sumner <mdsumner <at> utas.edu.au> writes:

> In R the data is stored as a "data frame" - which is basically a list of 
> same-length vectors that is matrix-alike via methods. (Real matrices in 
> R are just vectors with a "dim" attribute and appropriate methods).  For 
> SGDF each row holds each pixel's value, one column per band. In R the 
> data frame structure allows bands of different data type, a pathological 
> GDAL scenario but very useful in R generally.

GDAL handles different data types per band just fine. Some file format drivers
may disallow different types, but the GDAL API does not have this constraint.

Re the original post, I don't use sp classes that often, but I assume there is a
method to convert a SGDF to an ordinary data frame or matrix. Simply call
readGDAL and then convert to a matrix, probably using the "as" method.

THK





More information about the gdal-dev mailing list