raster (version 1.0.4)

writeRasterHdr: Header files

Description

Write header files to use together with raster binary files to read the data in other applications.

Usage

writeRasterHdr(raster, format)

Arguments

raster
RasterLayer object
format
Type of header file: 'BIL', 'ENVI', 'ErdasRaw', 'IDRISI', 'raster', 'SAGA'

Details

You can use saveAs to save a existing file in another format. You can also specify a non-default 'format' in writeRaster to obtain a different raster file format. But if you have a file in a 'raster' format (or similar), you can also only export a header file, and use the data file that already exists. writeHeader can write an ENVI, or BIL header (.hdr) file; an Erdas Raw (.raw) header file; an IDRISI (.rdc) or SAGA (.sgrd). This (hopefully) allows for reading the binary data ("raster.gri"), perhaps after changing the file extension, in other programs such as ENVI or ArcMap.

See Also

saveAs, writeRaster, writeGDAL

Examples

Run this code
r <- raster(system.file("external/test.grd", package="raster"))
r <- raster(r, filename='export.grd')
writeRasterHdr(r, format="ENVI")

Run the code above in your browser using DataLab