Description
This tool exports a raster to ASCII grid file format. The first 6 lines of the output text file contain header data in the following format:
ncols 43200
nrows 18000
xllcorner -180
yllcorner -60
cellsize 0.0083333337679505
NODATA_value -9999
-9999 -9999 ...
If you do not specify a nodata value, the command will attempt to acquire it automatically from the raster. It is probably wise to specify your own value, and -9999 is a frequently used value.
After the header data, the tool simply writes one line for each row in the input raster, with raster values delimited by spaces.
Syntax
export.asciigrid(in, out, [band], [nodata]);
| in | the input raster data source | |
| out | the output ASCII grid file to create, with the extension (usually .asc, .txt, or .grd) | |
| [band] | the band to export in the case of a multiband image (default=1) | |
| [nodata] | the NoData value to write to the text file; default is the rasters NoData value though it is recommended you explicitly specify a suitable value, e.g. -9999 |
Example
export.asciigrid(in="C:\data\dem.img", out="C:\data\elevation.asc", nodata=-9999);