Skip to content
Prev 4484 / 29559 Next

Using RGDAL to "copy" header information... (Jonathan Greenberg)

Jonathan

You might be interested in the raster package available from r-forge
(within the Rgis project). You would need to download, build and
install it 'manually'

The below code example reads a line from an input raster, puts the values

library(raster)
infile="d:/input.tif"
outfile="d:/test.grd"
rin <- raster.from.file(infile)
rout <- set.raster(rin, outfile)

for (r in 1:nrow(rin)) {
  rin <- read.row(rin, r)

  rout <- set.values.row(rout, values(rin) + 10, r)
  rout <- write.row(rout)
}



outfile_ext='.bil'