Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-20 Thread Roger Bivand
On Fri, 19 Sep 2008, milton ruser wrote: Dear all, I tryed both suggestions and they worked fine. In fact, the short solution is require(rgdal) require(maptools) mes01jan<-readGDAL("jan_00") write.asciigrid(mes01jan,"mes01jan.asc") One final note: write.asciigrid() in sp has arguments: args

Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread milton ruser
Dear all, I tryed both suggestions and they worked fine. In fact, the short solution is require(rgdal) require(maptools) mes01jan<-readGDAL("jan_00") write.asciigrid(mes01jan,"mes01jan.asc") Thanks Mike! Thanks Alex! best wishes, miltinho astronauta brazil On Fri, Sep 19, 2008 at 10:46 PM, Mic

Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread Alexander Brenning
Hi, an alternative to using GDAL for writing ASCII grids is the write.ascii.grid function in the RSAGA package. (RSAGA is an interface to SAGA GIS, but this function actually doesn't require SAGA to be installed on your computer.) write.ascii.grid(data, file, header = NULL, write.header = TR

Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread Michael Sumner
Of course, you can use write.asciigrid() in package sp for a more immediate workaround (sorry for not thinking of this previously!): e.g. x <- readGDAL(system.file("external/test.ag", package="sp")[1]) ## be aware that only the first raster column will be written by attr = 1 write.asciigrid(x

Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread Michael Sumner
I tried this, and AAIGrid is not available for creation by rgdal on my machine. See gdalDrivers() for those available. If you install FWTools you can use a workaround to convert the export externally, e.g. x <- readGDAL(system.file("external/test.ag", package="sp")[1]) ## write to GeoTIFF wr

Re: [R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread Michael Sumner
At a guess the Byte type might be causing problems, please provide (at a minimum) the actual error text you see, and (preferably) exact steps to reproduce the problem - is it specific to your dataset or does it fail with other datasets? Is there any difference if you change the output type or drive

[R-sig-Geo] from ArcGIS GRID to .ASC

2008-09-19 Thread milton ruser
Dear all, I am reading a set of maps from ArcGRID format using rgdal and I need to export to ASC format. But when I try the commands below, I get an error. require(rgdal) mes01jan<-readGDAL("jan_00") image(mes01jan, col=topo.colors(50)) #looks find writeGDAL(mes01jan, "mes01jan.asc", drivername