GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
r.out.xyz(1) GRASS GIS User's Manual r.out.xyz(1)

r.out.xyz - Exports a raster map to a text file as x,y,z values based on cell centers.

raster, export, output, ASCII, conversion

r.out.xyz
r.out.xyz --help
r.out.xyz [-i] input=name[,name,...] [output=name] [separator=character] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

-i

Include no data values
--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

input=name[,name,...] [required]

Name of input raster map(s)
output=name

Name for output file (if omitted or "-" output to stdout)
separator=character

Field separator
Special characters: pipe, comma, space, tab, newline
Default: pipe

The r.out.xyz module exports a raster map as a list of x,y,z values into an ASCII text file.

This module will by default not export x,y coordinates for raster cells containing a NULL value. This includes cells masked by a raster MASK. Using the flag -i also these raster cells will be included in the exported data.

This module, as all GRASS raster modules, will export cells based on the current region settings. See the g.region module for details.

The r.out.ascii module should be used to export an array (of size row x column) containing z values.

r.out.xyz can combine several input raster maps, which can be convenient when it comes to e.g. produce ASCII point cloud files.

r.out.xyz is simply a front-end to "r.stats -1g[n]".

In this example, a LiDAR elevation map in the North Carolina sample dataset location 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

Implement this script as a r.out.ascii option?

g.region, r.mask r.out.ascii, r.stats

M. Hamish Bowman
Dept. Marine Science
Otago University, New Zealand

Available at: r.out.xyz source code (history)

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2021 GRASS Development Team, GRASS GIS 7.8.6 Reference Manual

GRASS 7.8.6

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.