Displaying 1 result from an estimated 1 matches for "outfile_ext".
2008 Nov 05
1
Using RGDAL to "copy" header information...
...o using a combination of RGDAL and r-base
commands. Below is the basic structure, the input file "elev" can be
any image file GDAL supports -- the code below just "copies" the image
one line at a time:
###
library(rgdal)
infile='elev'
outfile_base='testout'
outfile_ext='.bil'
outfile=paste(outfile_base,outfile_ext,sep='')
outcon <- file(outfile, "wb")
infile_info=GDALinfo(infile)
nl=infile_info[[1]]
ns=infile_info[[2]]
for (row in 1:nl) {
templine <- readGDAL(infile,region.dim=c(1,ns),offset=c(row-1,0))
writeBin(templine[...