r.out.xyz(1)
π r.out.xyz β the manual, but make it cute π
okay so bestie, this is r.out.xyz from the GRASS GIS User's Manual. it's a little icon and it does exactly one thing but it does it so well. πΈ
KEYWORDS: raster, export, output, ASCII, conversion β¨
β¨ SYNOPSIS β¨
r.out.xyz
r.out.xyz --help
r.out.xyz [-i] input=name[,name,...] [output=name]
[separator=character] [--overwrite] [--help] [--verbose] [--quiet]
[--ui]
π Flags
-iβ Include no data values π (yes, the NULLs get an invite too)--overwriteβ Allow output files to overwrite existing files (chaotic but fine)--helpβ Print usage summary--verboseβ Verbose module output (it will tell you everything, and we love that)--quietβ Quiet module output (shhh π€«)--uiβ Force launching GUI dialog
π Parameters
input=name[,name,...][required] β Name of input raster map(s). yeah you have to give it something, it's not gonna guess bestieoutput=nameβ Name for output file (if omitted or-output to stdout). so if you ghost it, it just yells into your terminalseparator=characterβ Field separator. Special characters:pipe,comma,space,tab,newline. Default:pipe
π DESCRIPTION π
The r.out.xyz module exports a raster map as a list of x,y,z values into an ASCII text file. that's it. that's the whole vibe. π¦
πΈ NOTES πΈ
okay so, important stuff:
By default this module will not export x,y coordinates for raster cells containing a NULL value. That includes cells masked by a raster MASK. If you use the flag -i, then also these raster cells will be included in the exported data. periodt. π
This module, as all GRASS raster modules, will export cells based on the current region settings. See the g.region module for details. like, your region is the main character here, don't forget it.
The r.out.ascii module should be used to export an array (of size row x column) containing z values. different tool, different job, no cap.
r.out.xyz can combine several input raster maps, which can be convenient when it comes to e.g. produce ASCII point cloud files. lowkey iconic of it honestly. β¨
r.out.xyz is simply a front-end to "r.stats -1g[n]". iykyk. π
π§ EXAMPLES π§
In this example, a LiDAR elevation map in the North Carolina sample dataset is exported to CSV format.
g.region raster=elev_lid792_1m -p
r.out.xyz input=elev_lid792_1m output=elev_lid792_1m.csv separator=","
In this example, elevation data from the North Carolina dataset are exported along with R,G,B triplet of the related orthophoto into a combined file (requires the import of the supplementary high-resolution color orthophoto, here called "ortho2010_t792"):
g.region raster=elev_lid792_1m res=1 -a -p
r.out.xyz input=elev_lid792_1m,ortho2010_t792.red,ortho2010_t792.green,ortho2010_t792.blue \
separator=space output=pointcloud.asc
# validate: X Y Z R G B
head -n 3 pointcloud.asc
638300.5 220749.5 126.338218689 78 84 71
638301.5 220749.5 126.3381958008 93 101 86
638302.5 220749.5 126.3414840698 68 77 59
π TODO π
Implement this script as a r.out.ascii option? π (someone get on this fr fr)
π SEE ALSO π
g.region, r.mask r.out.ascii, r.stats
π AUTHOR π
M. Hamish Bowman Dept. Marine Science Otago University, New Zealand
π SOURCE CODE π
Available at: r.out.xyz source code (history)
Accessed: Saturday Jan 17 05:41:52 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie π«Ά Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual, and this little manual was brought to you by GRASS 8.4.2 β r.out.xyz(1). go forth and export ur points, u got this πβ¨π
π¦ 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