GRASS logo

NAME

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

KEYWORDS

raster3d, voxel, export

SYNOPSIS

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

Flags:

-h
Suppress printing of header information
-r
Switch the row order in output from north->south to south->north
-d
Switch the depth order in output from bottom->top to top->bottom
-c
Print grass6 compatible format. Flags -d and -r are ignored.
-m
Use 3D raster mask (if exists) with input map
--verbose
Verbose module output
--quiet
Quiet module output

Parameters:

input=string [required]
3D raster map to be converted to ASCII
output=string
Name for ASCII output file
dp=integer
Number of decimal places for floats
Options: 0-20
Default: 8
null=string
Char string to represent no data cell
Default: *

DESCRIPTION

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 -c flag will create GRASS 6 r3.in.ascii compatible output.

NOTES

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

The format of the ASCII file is:

version: "grass7"
order:   "nsbt" or "nstb" or "snbt" or "sntb"
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 version and order options have been introduced in GRASS 7 in June 2011. The order option describes the order of rows and depths in the output. It is possible to create output of different row order using the -r flag and output of different depths order using the -d flag. The default order is:

west -> east for columns
north -> south for rows
bottom -> top for depths
This order is compatible with the r.in.ascii row -> column ordering. The column order can not be changed but the row and depth order. Supported orders are: 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 in case of the default north -> south and bottom -> top (nsbt) ordering:
  (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)
      .                 .                           .
      .                 .                           .
      .                 .                           .
(x, y + rows, z) (x + 1, y + rows, z) ... (x + cols, y + rows, z)


  (x, y, z + 1)       (x + 1, y, z + 1)     ...     (x + cols, y, z + 1)
(x, y + 1, z + 1)   (x + 1, y + 1, z + 1)   ...   (x + cols, y + 1, z + 1)
      .                 .                           .
      .                 .                           .
      .                 .                           .
(x, y + rows, z + 1)   (x + 1, y + rows, z + 1) ... (x + cols, y + rows, z + 1)

and so on.
The data starts with the upper left corner (NW) at the bottom of the data set.

One level maps can be imported with r.in.ascii (2D raster) using the default nsbt order and removing the header lines "version", "order", "top", "bottom" and "levels".

SEE ALSO

r3.in.ascii, g.region

AUTHORS

Roman Waupotitsch, Michael Shapiro, Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka, Sören Gebbert

Last changed: $Date: 2011-11-08 13:24:20 -0800 (Tue, 08 Nov 2011) $


Main index - Raster3D index - Full index

© 2003-2012 GRASS Development Team