r.in.ascii(1)
π r.in.ascii π
okay bestie, so r.in.ascii is the GRASS GIS module that takes a GRASS ASCII raster file and turns it into a binary raster map. glow-up from text to raster, no cap β¨
KEYWORDS: raster, import, conversion, ASCII
β¨ SYNOPSIS β¨
r.in.ascii
r.in.ascii --help
r.in.ascii [-s] input=name output=name [type=string] [title=phrase]
[multiplier=float] [null_value=string] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π Flags π
-sβ SURFER (Golden Software) ASCII file will be imported--overwriteβ Allow output files to overwrite existing files--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 inputoutput=name[required] β Name for output raster maptype=stringβ Type of raster map to be created. Default:CELLfor integer values,DCELLfor floating-point values. Options:CELL,FCELL,DCELLCELL: IntegerFCELL: Single precision floating pointDCELL: Double precision floating point
title=phraseβ Title for resultant raster mapmultiplier=floatβ Multiplier for ASCII data. Default: read from headernull_value=stringβ String representing NULL value data cell. Default: read from header
π DESCRIPTION π
r.in.ascii lets you create a (binary) GRASS raster map layer from an ASCII raster input file with an (optional) TITLE. it's giving β¨text-to-rasterβ¨
The GRASS ASCII input file has a header section which describes the location and size of the data, followed by the data itself.
The header has 6 lines:
north: xxxxxx.xx
south: xxxxxx.xx
east: xxxxxx.xx
west: xxxxxx.xx
rows: r
cols: c
The north, south, east, and west field values entered are the coordinates of the edges of the geographic region. The rows and cols field values entered describe the dimensions of the matrix of data to follow. The data which follows is r rows of c integers.
Optionally the following parameters can be defined in the header section:
null: nn
type: float
multiplier: 2.
"null"defines a string or number to be converted to NULL value (no data)."type"defines the data type (int,float double) and is not required."multiplier"is an optional parameter to multiply each cell value.
π NOTES π
The geographic coordinates north, south, east, and west describe the outer edges of the geographic region. They run along the edges of the cells at the edge of the geographic region and not through the center of the cells at the edges. The NW value occurs at the beginning of the first line of data, and the SW value occurs at the beginning of the last line of data. iykyk π«Ά
The data (which follows the header section) must contain r x c values, but it is not necessary that all the data for a row be on one line. A row may be split over many lines. lowkey flexible, we love that for us π¦
The imported cell type can be forced using the type option, default is auto-detection.
heads up bestie: the header information in ESRI Raster ASCII files differs from GRASS. To convert an Arc/Info (ArcView) ASCII grid file into GRASS, see r.in.gdal.
SURFER (Golden Software) ASCII files may be imported by passing the -s flag. π
β EXAMPLE β
The following is a sample input file to r.in.ascii:
north: 4299000.00
south: 4247000.00
east: 528000.00
west: 500000.00
rows: 10
cols: 15
null: -9999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
π¦ SEE ALSO π¦
r.importr.out.asciir.in.gdalr.out.gdalr.in.binr3.in.ascii
π AUTHORS π
- Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
- Surfer support by Roger Miller
π SOURCE CODE π
Available at: r.in.ascii source code (history)
Accessed: Saturday Jan 17 05:40:47 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole thing bestie, you ate that π and for the sign-off: this was GRASS GIS 8.4.2 Reference Manual energy, Β© 2003-2025 GRASS Development Team, running GRASS 8.4.2, accessed Saturday Jan 17 05:40:47 2026 β periodt. π«Άπβ¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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