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 bestie
  • output=name β€” Name for output file (if omitted or - output to stdout). so if you ghost it, it just yells into your terminal
  • 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 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