1r.out.xyz(1) GRASS GIS User's Manual r.out.xyz(1)
2
3
4
6 r.out.xyz - Exports a raster map to a text file as x,y,z values based
7 on cell centers.
8
10 raster, export, output, ASCII, conversion
11
13 r.out.xyz
14 r.out.xyz --help
15 r.out.xyz [-i] input=name[,name,...] [output=name] [separator=char‐
16 acter] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
17
18 Flags:
19 -i
20 Include no data values
21
22 --overwrite
23 Allow output files to overwrite existing files
24
25 --help
26 Print usage summary
27
28 --verbose
29 Verbose module output
30
31 --quiet
32 Quiet module output
33
34 --ui
35 Force launching GUI dialog
36
37 Parameters:
38 input=name[,name,...]Â [required]
39 Name of input raster map(s)
40
41 output=name
42 Name for output file (if omitted or "-" output to stdout)
43
44 separator=character
45 Field separator
46 Special characters: pipe, comma, space, tab, newline
47 Default: pipe
48
50 The r.out.xyz module exports a raster map as a list of x,y,z values
51 into an ASCII text file.
52
54 This module will by default not export x,y coordinates for raster cells
55 containing a NULL value. This includes cells masked by a raster MASK.
56 Using the flag -i also these raster cells will be included in the ex‐
57 ported data.
58
59 This module, as all GRASS raster modules, will export cells based on
60 the current region settings. See the g.region module for details.
61
62 The r.out.ascii module should be used to export an array (of size row x
63 column) containing z values.
64
65 r.out.xyz can combine several input raster maps, which can be conve‐
66 nient when it comes to e.g. produce ASCII point cloud files.
67
68 r.out.xyz is simply a front-end to "r.stats -1g[n]".
69
71 In this example, a LiDAR elevation map in the North Carolina sample
72 dataset location is exported to CSV format.
73 g.region raster=elev_lid792_1m -p
74 r.out.xyz input=elev_lid792_1m output=elev_lid792_1m.csv separator=","
75
76 In this example, elevation data from the North Carolina dataset are ex‐
77 ported along with R,G,B triplet of the related orthophoto into a com‐
78 bined file (requires the import of the supplementary high-resolution
79 color orthophoto, here called "ortho2010_t792"):
80 g.region raster=elev_lid792_1m res=1 -a -p
81 r.out.xyz input=elev_lid792_1m,ortho2010_t792.red,ortho2010_t792.green,ortho2010_t792.blue \
82 separator=space output=pointcloud.asc
83 # validate: X Y Z R G B
84 head -n 3 pointcloud.asc
85 638300.5 220749.5 126.338218689 78 84 71
86 638301.5 220749.5 126.3381958008 93 101 86
87 638302.5 220749.5 126.3414840698 68 77 59
88
90 Implement this script as a r.out.ascii option?
91
93 g.region, r.mask r.out.ascii, r.stats
94
96 M. Hamish Bowman
97 Dept. Marine Science
98 Otago University, New Zealand
99
101 Available at: r.out.xyz source code (history)
102
103 Accessed: Mon Jun 20 16:47:45 2022
104
105 Main index | Raster index | Topics index | Keywords index | Graphical
106 index | Full index
107
108 © 2003-2022 GRASS Development Team, GRASS GIS 8.2.0 Reference Manual
109
110
111
112GRASS 8.2.0 r.out.xyz(1)