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

Michael Sumner mdsumner at utas.edu.au
Sat Sep 20 02:50:19 CEST 2008


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, "mes01jan.asc")

## which on my machine results in
system("gdalinfo mes01jan.asc")
Driver: AAIGrid/Arc/Info ASCII Grid
Files: mes01jan.asc
       mes01jan.asc.aux.xml
Size is 80, 115
Coordinate System is `'
Origin = (178400.000000000000000,334000.000000000000000)
Pixel Size = (40.000000000000000,-40.000000000000000)
Corner Coordinates:
Upper Left  (  178400.000,  334000.000)
Lower Left  (  178400.000,  329400.000)
Upper Right (  181600.000,  334000.000)
Lower Right (  181600.000,  329400.000)
Center      (  180000.000,  331700.000)
Band 1 Block=80x1 Type=Float32, ColorInterp=Gray
  NoData Value=-9999

Sorry for all the unnecessary email traffic . . .

Cheers, Mike.
milton ruser wrote:
> 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 = "AAIGrid", type="Byte")
>
> Any idea?
>
> miltinho, brazil
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.169 / Virus Database: 270.7.0/1681 - Release Date: 9/19/2008 3:54 PM
>
>




More information about the R-sig-Geo mailing list