GRASS logo

Note: A new GRASS GIS stable version has been released: GRASS GIS 7. Go directly to the new manual page here


r3.out.ascii - Converts a 3D raster map layer into an ASCII text file.


raster3d, voxel, export


r3.out.ascii help
r3.out.ascii [-hm] input=string [output=string] [dp=integer] [null=string] [--verbose] [--quiet]


Suppress printing of header information
Use 3D raster mask (if exists) with input map
Verbose module output
Quiet module output


3D raster map to be converted to ASCII
Name for ASCII output file
Number of decimal places for floats
Options: 0-20
Default: 8
Char string to represent no data cell
Default: *


Outputs 3D raster maps in ASCII format. The map parameter is a valid 3D raster map in the current mapset search path. The output parameter is the name of an ASCII file which will be written in the current working directory.

If output is not specified then standard output (stdout) is used. The -h flag may be used to suppress header information. The module is sensitive to region settings (set with g.region).


The default format for the ASCII file is equivalent to that required by In particular, files output by r3.out.ascii with header information may be converted back to 3D raster maps with

The format of the ASCII file is:

north:   floating point
south:   floating point
east:    floating point
west:    floating point
top:     floating point
bottom:  floating point
rows:    integer
cols:    integer
levels:  integer
The header is followed by cell values in floating point format. Cell values are output as a series of horizontal slices in row-major order. That is,
  (x, y, z)       (x + 1, y, z)     ...     (x + cols, y, z)
(x, y + 1, z)   (x + 1, y + 1, z)   ...   (x + cols, y + 1, z)

and so on.

One level maps can be imported with (2D raster) after removing the header lines "top", "bottom" and "levels".

SEE ALSO, g.region


Roman Waupotitsch, Michael Shapiro, Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka

Last changed: $Date: 2011-09-13 13:13:36 -0700 (Tue, 13 Sep 2011) $

Main index - raster3D index - Full index

© 2003-2016 GRASS Development Team