Skip to content

export to .asc or .grd files

4 messages · Maxime Pauwels, Carsten Neumann

#
Hi list,

I'm using the sp package to grid data. I'd now like to export the grid 
in either .asc or .grd files. Does anyone can give me the package and 
function that does it easily?

Thanks,

max
#
Am 20.12.2010 18:02, schrieb Maxime Pauwels:
Hi Max,

library(raster); use with function: writeRaster("raster object", "name", 
format="ascii"); format="raster" for *.grd files

library(rgdal); use with function: writeGDAL("rgdal object", 
fname="name", drivername="AAIGrid"); use gdalDrivers() to identify your 
preferred drivername for *.grd

you certainly have to change your grid object to a raster object when 
using raster package.

All the best!

Carsten
1 day later
#
Hi Carsten,

Thanks for your help. I never used rgdal before and therefore do not 
understand what drivername is.
When I try your proposition, I ve got the following error message:

Error in .local(.Object, ...) :
         GDAL Error 6: GDALDriver::Create() ... no create method 
implemented for this format.

Where am I wrong?

best regards,

max



Le 21/12/2010 12:21, Carsten Neumann a ?crit :