123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <h2>DESCRIPTION</h2>
- <em>r3.out.ascii</em> exports a 3D raster map in ASCII format. The <em>input</em> parameter is
- a valid 3D raster map in the current mapset search path. The <em>output</em>
- parameter is the name of an ASCII file which will be written in the
- current working directory.
- <p>If <em>output</em> is not specified then standard output (stdout) is used.
- The <em>-h</em> flag may be used to suppress header information. The
- module is sensitive to region settings (set with <em>g.region</em>).
- <p>The <em>-c</em> flag will create GRASS 6 <em>r3.in.ascii</em> compatible
- output.
- <h2>NOTES</h2>
- The default format of the exported ASCII file is equivalent to that required
- by <em>r3.in.ascii</em>. In particular, files output by
- <em>r3.out.ascii</em> with header information may be converted back to
- 3D raster maps with <em>r3.in.ascii</em>.
- <p>
- The format of the ASCII file is:
- <div class="code"><pre>
- version: <i>"grass7"</i>
- order: <i>"nsbt" or "nstb" or "snbt" or "sntb"</i>
- north: <i>floating point</i>
- south: <i>floating point</i>
- east: <i>floating point</i>
- west: <i>floating point</i>
- top: <i>floating point</i>
- bottom: <i>floating point</i>
- rows: <i>integer</i>
- cols: <i>integer</i>
- levels: <i>integer</i>
- </pre></div>
- The <b>version</b> and <b>order</b> options have been introduced in GRASS 7 in June 2011.
- The <b>order</b> option describes the order of rows and depths in the output.
- It is possible to create output of different row order using the <em>-r</em> flag
- and output of different depths order using the <em>-d</em> flag. The default order is:
- <p><div class="code"><pre>
- west -> east for columns
- north -> south for rows
- bottom -> top for depths
- </pre></div>
- <p>
- This header is followed by the cell values in <em>floating point</em> format
- organized in rows with constant <em>col</em> and <em>level</em> coordinate.
- The rows are organized by constant <em>level</em> coordinate. Individual cell
- values are separated by <em>space</em> or <em>CR</em>.
- Cell values are exported as a series of horizontal slices in row-major
- order. The data starts with the upper left corner (NW) at the bottom of the data set.
- The values at the following coordinates are exported:
- <div class="code"><pre>
- (x, y + rows, z) (x + 1, y + rows, z) ... (x + cols, y + rows, z)
- (x, y + rows, z) (x + 1, y + rows - 1, z) ... (x + cols, y + rows - 1, z)
- . . .
- . . .
- . . .
- (x, y, z + depths) (x + 1, y, z + depths) ... (x + cols, y, z + depths)
- </pre></div>
- This order is compatible with the <em>r.in.ascii</em> row -> column ordering.
- <p>
- Supported orders are:
- <ul>
- <li><b>nsbt</b>: north -> south and bottom -> top ordering which is the default (no flags)</li>
- <li><b>snbt</b>: south -> north and bottom -> top ordering using <em>-r</em> flag</li>
- <li><b>nstb</b>: north -> south and top -> bottom ordering using <em>-d</em> flag</li>
- <li><b>sntb</b>: south -> north and top -> bottom ordering using <em>-rd</em> flag</li>
- </ul>
- <p>
- The internal storage scheme of 3D raster maps is visualized in the following picture:
- <center>
- <img src="raster3d_layout.png" border=0><br>
- <table border=0 width=700>
- <tr><td><center>
- <i>The coordinate system and tile layout of a voxel map in GRASS</i>
- </center></td></tr>
- </table>
- </center>
- <p>
- One level maps can be imported with <em>r.in.ascii</em> (2D raster) using
- the default <b>nsbt</b> order and removing the header lines "version",
- "order", "top", "bottom" and "levels".
- <h2>Example</h2>
- We define a small region with 4 columns, 3 rows and 2 depths (4x3x2) and export
- it using different ordering definitions:
- <div class="code"><pre>
- g.region res3=1 t=2 b=0 w=0 e=4 s=0 n=3
- r3.mapcalc "simple_example = row() + col() + depth()"
- </pre></div>
- Default order:
- <div class="code"><pre>
- r3.out.ascii input=simple_example dp=0
- version: grass7
- order: nsbt
- north: 3.000000
- south: 0.000000
- east: 4.000000
- west: 0.000000
- top: 2.000000
- bottom: 0.000000
- rows: 3
- cols: 4
- levels: 2
- 3 4 5 6
- 4 5 6 7
- 5 6 7 8
- 4 5 6 7
- 5 6 7 8
- 6 7 8 9
- </pre></div>
- Inverse row order (-r)
- <div class="code"><pre>
- r3.out.ascii input=simple_example dp=0 -r
- version: grass7
- order: snbt
- north: 3.000000
- south: 0.000000
- east: 4.000000
- west: 0.000000
- top: 2.000000
- bottom: 0.000000
- rows: 3
- cols: 4
- levels: 2
- 5 6 7 8
- 4 5 6 7
- 3 4 5 6
- 6 7 8 9
- 5 6 7 8
- 4 5 6 7
- </pre></div>
- Inverse depth order (-d)
- <div class="code"><pre>
- r3.out.ascii input=simple_example dp=0 -d
- version: grass7
- order: nstb
- north: 3.000000
- south: 0.000000
- east: 4.000000
- west: 0.000000
- top: 2.000000
- bottom: 0.000000
- rows: 3
- cols: 4
- levels: 2
- 4 5 6 7
- 5 6 7 8
- 6 7 8 9
- 3 4 5 6
- 4 5 6 7
- 5 6 7 8
- </pre></div>
- Inverse row and depth order (-rd)
- <div class="code"><pre>
- r3.out.ascii input=simple_example dp=0 -rd
- version: grass7
- order: sntb
- north: 3.000000
- south: 0.000000
- east: 4.000000
- west: 0.000000
- top: 2.000000
- bottom: 0.000000
- rows: 3
- cols: 4
- levels: 2
- 6 7 8 9
- 5 6 7 8
- 4 5 6 7
- 5 6 7 8
- 4 5 6 7
- 3 4 5 6
- </pre></div>
- <h2>SEE ALSO</h2>
- <em>
- <a href="r3.in.ascii.html">r3.in.ascii</a>,
- <a href="r.out.ascii.html">r.out.ascii</a>,
- <a href="g.region.html">g.region</a>
- </em>
- <h2>AUTHORS</h2>
- Roman Waupotitsch, Michael Shapiro,
- Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka, Sören Gebbert
- <p><i>Last changed: $Date$</i>
|