On Fri, 10 Jul 2009, Roger Bivand wrote:

On Thu, 9 Jul 2009, Jonathan Greenberg wrote:

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)?

You'll need to use the options= argument to pass through these values when you instantiate the transient dataset. There is an example of its use in ?writeOGR.

Sorry, ?writeGDAL, of course. The valid options are given on the GDAL supported formats pages for creation and/or copying - not (naturally) the reading options.


Roger

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






--
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.biv...@nhh.no

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

Reply via email to