r.in.ascii(1grass)
β¨ r.in.ascii β the GRASS User's Manual glow-up β¨
okay bestie, gather round, because r.in.ascii is literally the moment π
it lives in the GRASS User's Manual and it's here to take your ASCII raster file and turn it into a whole binary raster map. glow up from text file to icon status. π
π NAME π
r.in.ascii β converts a GRASS ASCII raster file to binary raster map. that's it, that's the job, and it ATE. π₯
π KEYWORDS π
raster, import, conversion, ASCII β yeah she's all of those things, multi-hyphenate queen.
πΈ 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β the SURFER (Golden Software) ASCII file will be imported. like, yes, that Surfer. π--overwriteβ allow output files to overwrite existing files. permission slip granted, no cap.--helpβ print usage summary. when you're lost, bestie, just ask. π«Ά--verboseβ verbose module output. she will NOT stop talking and honestly? respect.--quietβ quiet module output. the opposite energy. π€«--uiβ force launching GUI dialog. for the girlies who need a lil visual moment. β¨
π Parameters π
input=name[required] β name of input file to be imported. and listen:'-'for standard input. iconic behaviour honestly.output=name[required] β name for output raster map. name your baby. πΌtype=stringβ type of raster map to be created. Default:CELLfor integer values,DCELLfor floating-point values. Options:CELL,FCELL,DCELL.CELL: IntegerFCELL: Single precision floating pointDCELL: Double precision floating point
title=phraseβ title for resultant raster map.multiplier=floatβ multiplier for ASCII data. Default: read from header.null_value=stringβ string representing NULL value data cell. Default: read from header.
π DESCRIPTION π
r.in.ascii lets a user create a (binary) GRASS raster map layer from an ASCII raster input file, with an (optional) TITLE. yes, optional title, live your life. π
the GRASS ASCII input file has a header section which describes the location and size of the data, followed by the data itself. header first, then the main character. π
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. fr fr, that's the whole deal.
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. lowkey important, don't skip this part bestie, it's giving edge-not-center. π
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. so flexible, we love a fluid queen. π
the imported cell type can be forced using the type option, default is auto-detection. she'll figure it out herself but you CAN step in. π
β οΈ heads up!! 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. don't try to make this one do a job it's not built for, that's messy. π
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
so satisfying. no notes. π
π₯ SEE ALSO π₯
r.import, r.out.ascii, r.in.gdal, r.out.gdal, r.in.bin, r3.in.ascii β your little friend group, all linked, all slaying in their own lanes. π«Ά
π AUTHORS π
- Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
- Surfer support by Roger Miller
(legends, both of them, periodt.)
π SOURCE CODE π
available at: r.in.ascii source code (history)
latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole page bestie, and now the cute sign-off: this was the GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, running GRASS 8.5.0, and this little icon is r.in.ascii(1grass) πβ¨ go import something gorgeous. π¦πΈ
π¦ 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