Geospatial Modelling Environment

export.asciigrid (Export To ASCII Grid)

Exports a raster to ASCII grid format (text file format with header data)


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.


export.asciigrid(in, out, [band], [nodata]);

inthe input raster data source
outthe 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


export.asciigrid(in=”C:datadem.img”, out=”C:dataelevation.asc”, nodata=-9999);


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn