r.out.xyz(1grass)
π r.out.xyz β the GRASS User's Manual glow-up π
okay bestie, welcome to r.out.xyz(1grass), she's a raster-export icon and she's about to hand you your pixels as plain old x,y,z text, no cap β¨
β¨ NAME β¨
r.out.xyz β she exports a raster map to a text file as x,y,z values, based on cell centers. periodt.
π·οΈ KEYWORDS π·οΈ
raster, export, output, ASCII, conversion β yeah she's giving all of that π
π 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. like, she'll snitch on the empty cells too π--overwriteβ allow output files to overwrite existing files. yes she will bulldoze your old file, consent given π--helpβ print usage summary. the little "what does this even do" button π«Ά--verboseβ verbose module output. she will yap, affectionately--quietβ quiet module output. she will NOT yap--uiβ force launching GUI dialog. clicks instead of keystrokes, main character energy π
π§ Parameters:
input=name[,name,...][required] β name of input raster map(s). yes, plural, she's polyamorous with maps πoutput=nameβ name for output file (if omitted or"-", output goes to stdout, i.e. straight into your terminal's DMs)separator=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 flex π₯
π NOTES π
Bestie, listen, here's the tea:
By default this module will not export x,y coordinates for raster cells containing a NULL value. This includes cells masked by a raster mask. But if you use the flag -i, then those raster cells get included in the exported data too. inclusivity slay π
This module, as all GRASS raster modules, will export cells based on the current region settings. See the g.region module for details. so like, region settings run this whole thing, iykyk
The r.out.ascii module should be used to export an array (of size row x column) containing z values. different vibe, different purpose, don't mix them up π
r.out.xyz can combine several input raster maps, which can be convenient when it comes to e.g. produce ASCII point cloud files. multi-map combo, iconic π
r.out.xyz is simply a front-end to "r.stats -1g[n]". she's not doing the heavy lifting herself, she's the pretty face β¨
π 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
look at those numbers go π she ATE
β TODO β
Implement this script as a r.out.ascii option? like... food for thought, bestie π€
π¦ SEE ALSO π¦
g.region, r.mask r.out.ascii, r.stats
(the original lists them like that, so I'm keeping them exactly like that, no editorializing from me π)
π AUTHOR π
M. Hamish Bowman Dept. Marine Science Otago University, New Zealand
π SOURCE CODE π
Available at: r.out.xyz source code (history)
Latest change: Thursday Nov 06 22:27:54 2025 in commit: 298b38614712934179355ea767403d6bfea8f5f9
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie β¨
cute little sign-off: this was GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, straight out of the GRASS 8.5.0 Reference Manual, and the last touch on it was Thursday Nov 06 22:27:54 2025 in commit 298b38614712934179355ea767403d6bfea8f5f9 π stay hydrated, back up your files, and go export something cute π
π¦ 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