r3.in.ascii(1grass)
π r3.in.ascii π
okay bestie, gather round, because this is the iconic little module from the GRASS User's Manual that turns your sad flat text file into a full-on binary 3D raster map. yes. three dimensions. voxels. main character energy fr fr. β¨
r3.in.ascii(1grass) β she converts a 3D ASCII raster text file into a (binary) 3D raster map, and she does it flawlessly. π
πΈ NAME πΈ
r3.in.ascii β Converts a 3D ASCII raster text file into a (binary) 3D raster map.
π KEYWORDS π
raster3d, import, voxel, conversion, ASCII
β¨ SYNOPSIS β¨
r3.in.ascii
r3.in.ascii --help
r3.in.ascii input=name output=name [null_value=string] [type=string]
[precision=string] [compression=string] [tiledimension=XxYxZ]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π«Ά Flags
--overwriteβ Allow output files to overwrite existing files. yes she will simply replace the thing. careful bestie π--helpβ Print usage summary--verboseβ Verbose module output--quietβ Quiet module output--uiβ Force launching GUI dialog
π¦ Parameters
input=name[required] β Name of input file to be imported.'-'for standard input. so if you're feeling spicy you can pipe it in, no cap.output=name[required] β Name for output 3D raster mapnull_value=stringβ String representing NULL value data cell (use'none'if no such value) Default:*type=stringβ Data type used in the output raster3d map Options:default,double,floatDefault:defaultprecision=stringβ Number of digits used as mantissa in the internal map storage,0-23for float,0-52for double,maxordefaultDefault:defaultcompression=stringβ The compression method used in the output raster3d map Options:default,zip,noneDefault:defaulttiledimension=XxYxZβ The dimensions of the tiles used in the output raster3d map (XxYxZor default:16x16x8) Default:default
π DESCRIPTION π
r3.in.ascii allows a user to create a (binary) GRASS 3D raster map layer from a 3D ASCII raster input file. literally that's the whole vibe and she ate. π₯
The tiledimension parameter defines the dimension of the tiles used in the output file. The format is: XxYxZ β¨
The nv parameter specifies which value to convert to NULL-value. If the specified value is none, no conversion is performed. Default is none.
π NOTES π
The data is automatically imported into the correct internal coordinate system, that is visualized in the following picture, independently from the specified ordering in the ASCII input file:
The volume coordinate system and tile layout of the imported voxel map π
π Format
The format of the 3D ASCII file:
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 option have been introduced in GRASS 7 in June 2011. The version option is self explaining. The order option specifies the row and depth order of the data in the input file. The supported row/depth ordering is documented in the r3.out.ascii manual page. The order of the data in the input file does not specify the data order in the generated output 3D raster map which is in any case north -> south, west -> east, bottom -> top order. So dependent on the order information the data is automatically imported into the correct internal coordinate system. π§
The version and order options are not mandatory. In case no version and order option is specified, the default GRASS 6 ASCII format is assumed. (grandma format. still valid. we respect her. π)
This header is followed by the cell values in floating point format organized in rows with constant col and level coordinate. The rows are organized by constant level coordinate. Individual cell values are separated by space or CR.
π EXAMPLES π
4x3x2 sample. Note in case no specific ordering is specified in the input file the upper-left (NW) corner of the bottom level comes first. The according order option is: nsbt for north -> south, bottom -> top ordering. This is identical with r.in.ascii for single level data. So the y coordinate is 0 at the northern edge. π
north: 3.0
south: 0.0
east: 4.0
west: 0.0
top: 2.0
bottom: 0.0
rows: 3
cols: 4
levels: 2
w111x1,y1,z1 w211x2,y1,z1 w311x3,y1,z1 w411x4,y1,z1
w121x1,y2,z1 w221x2,y2,z1 w321x3,y2,z1 w421x4,y2,z1
w131x1,y3,z1 w231x2,y3,z1 w331x3,y3,z1 w431x4,y3,z1
w112x1,y1,z2 w212x2,y1,z2 w312x3,y1,z2 w412x4,y1,z2
w122x1,y2,z2 w222x2,y2,z2 w322x3,y2,z2 w422x4,y2,z2
w132x1,y3,z2 w232x2,y3,z2 w332x3,y3,z2 w432x4,y3,z2
Note that unit tests for r3.in.ascii are implemented in the test.r3.out.ascii.sh script located in the r3.out.ascii directory. π
π EXAMPLES π
Please refer to the detailed examples in r3.out.ascii. (go go go, bestie, she's got the receipts π
)
π SEE ALSO π
r.in.ascii, r3.out.ascii, v.to.rast3, g.region
π«Ά AUTHORS π«Ά
Roman Waupotitsch, Michael Shapiro, Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka, SΓΆren Gebbert β absolute legends, every single one, no notes π
π» SOURCE CODE π»
Available at: r3.in.ascii source code (history)
Latest change: Tuesday Feb 18 17:20:26 2025 in commit: 688e625e7db3be9a465ce99ba25f36d2ebdd5aeb
Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index
okay and that's the whole page, bestie!! πΈ every flag, every default, every w111x1,y1,z1 lovingly preserved, zero facts harmed. go make some voxels, you absolute icon. π¦π
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
this whole thing came to you from GRASS 8.5.0 and the one and only r3.in.ascii(1grass) β mwah, periodt π β¨π
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms