Skip to content
Prev 6049 / 29559 Next

How do I set ENVI file interleave when using GDALTransientDataset?

I'm writing a function to mimic ENVI/IDL's "ENVI_SETUP_HEAD" using 
rgdal, and I was wondering how I set the interleave (BIP vs BSQ vs 
BIL)?  The subsection of my code that I assume this belongs in is below:

    driver="ENVI"
    d.drv <- new("GDALDriver", driver)
    tds.out <- new("GDALTransientDataset", driver = d.drv, rows = 
dims[2],cols = dims[1], bands = bands, type = type)
    gt <- c(offset[1] - 0.5 * cellsize[1], cellsize[1], 0.0,offset[2] + 
(dims[2] -0.5) * cellsize[2], 0.0, -cellsize[2])
    .Call("RGDAL_SetGeoTransform", tds.out, gt, PACKAGE = "rgdal")
    .Call("RGDAL_SetProject", tds.out, file_projection, PACKAGE = "rgdal")
    fn <- tempfile()
    saveDataset(tds.out, fn)

Thanks!

--j