Skip to content

how to write ESRI grids from R

2 messages · Pascal Title, Bacou, Melanie

#
I am trying to convert some rasters to the formats in which the WorldClim
dataset is provided: generic grids and ESRI grids.
The generic grids are provided as 2 files, a .bil and .hdr.
The ESRI grids are provided as a directory of .adf files and a info
directory.

I find that writing a raster with writeRaster() from the raster package
with format = 'EHdr' generates 4 files, with extensions ".aux.xml", ".hdr",
".prj" and ".bil". This seems to be the "generic grid" format, with some
additional files.

However, I can't find the ESRI grid format in R. Is the reason that it is a
proprietary format and I need to go through ArcGIS, or is it possible to
use this format in R?

Thanks!
-Pascal
#
You can use:
writeGDAL(x, drivername="AAIGrid", ...)
or simply use a ".asc" file extention:
writeRaster(x, filename="fileName.asc", ...)

See raster::WriteFormats().

--Mel.
On 7/24/2016 11:41 AM, Pascal Title wrote: