.TH r.out.xyz 1grass "" "GRASS 6.4.4" "Grass User's Manual"
.SH NAME
\fI\fBr.out.xyz\fR\fR  - Export a raster map to a text file as x,y,z values based on cell centers.
.SH KEYWORDS
raster, export
.SH SYNOPSIS
\fBr.out.xyz\fR
.br
\fBr.out.xyz help\fR
.br
\fBr.out.xyz input\fR=\fIname\fR[,\fIname\fR,...]  [\fBoutput\fR=\fIname\fR]   [\fBfs\fR=\fIcharacter\fR]   [\-\-\fBverbose\fR]  [\-\-\fBquiet\fR] 
.SS Parameters:
.IP "\fBinput\fR=\fIname[,\fIname\fR,...]\fR" 4m
.br
Name of input raster map
.IP "\fBoutput\fR=\fIname\fR" 4m
.br
Name for output file (if omitted or "-" output to stdout)
.IP "\fBfs\fR=\fIcharacter\fR" 4m
.br
Field separator
.br
Default: \fI|\fR
.PP
.SH DESCRIPTION
The \fIr.out.xyz\fR module exports a raster map as a list of x,y,z
values into an ASCII text file.
.PP
.SH NOTES
This module will not export x,y coordinates for raster cells containing
a NULL value. This includes cells masked by a raster MASK.
.PP
This module, as all GRASS raster modules, will export cells based on the
current region settings. See the \fIg.region\fR module for details.
.PP
The \fIr.out.ascii\fR module should be used to export an array (of
size row x column) containing z values.
.PP
\fIr.out.xyz\fR can combine several input raster maps, which can be 
convenient when it comes to e.g. produce ASCII point cloud files.
.PP
\fIr.out.xyz\fR is simply a front-end to "r.stats -1gn".
.SH EXAMPLES
In this example, a LiDAR elevation map in the
North Carolina sample dataset location is exported to CSV format.
\fC
.DS
.br
g.region rast=elev_lid792_1m \-p
.br
r.out.xyz input=elev_lid792_1m output=elev_lid792_1m.csv fs=","
.br
.DE
\fR
.PP
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"):
\fC
.DS
.br
g.region rast=elev_lid792_1m res=1 \-a \-p
.br
# R=1, G=2, B=3
.br
r.out.xyz input=elev_lid792_1m,ortho2010_t792.1,ortho2010_t792.2,ortho2010_t792.3 \(rs
.br
        fs=space output=pointcloud.asc
.br
.br
# validate: X Y Z R G B
.br
head \-n 3 pointcloud.asc
.br
638300.5 220749.5 126.338218689 78 84 71
.br
638301.5 220749.5 126.3381958008 93 101 86
.br
638302.5 220749.5 126.3414840698 68 77 59
.br
.DE
\fR
.SH TODO
Implement this script as a \fIr.out.ascii\fR option?
.SH SEE ALSO
\fI
g.region,
r.mask
r.out.ascii,
r.stats
\fR
.SH AUTHOR
M. Hamish Bowman
.br
\fIDept. Marine Science
.br
Otago University, New Zealand\fR
.PP
\fILast changed: $Date: 2013-12-03 22:26:15 +0100 (Tue, 03 Dec 2013) $\fR
.PP
Full index
.PP
© 2003-2014 GRASS Development Team
