1r.out.vtk(1) GRASS GIS User's Manual r.out.vtk(1)
2
3
4
6 r.out.vtk - Converts raster maps into the VTK-ASCII format.
7
9 raster, export, output, VTK
10
12 r.out.vtk
13 r.out.vtk --help
14 r.out.vtk [-pstvoc] [input=name[,name,...]] [output=name] [eleva‐
15 tion=name] [null=float] [z=float] [rgbmaps=string[,string,...]]
16 [vectormaps=string[,string,...]] [zscale=float] [precision=integer]
17 [--overwrite] [--help] [--verbose] [--quiet] [--ui]
18
19 Flags:
20 -p
21 Create VTK point data instead of VTK cell data (if no elevation map
22 is given)
23
24 -s
25 Use structured grid for elevation (not recommended)
26
27 -t
28 Use polydata-trianglestrips for elevation grid creation
29
30 -v
31 Use polydata-vertices for elevation grid creation (to use with
32 vtkDelauny2D)
33
34 -o
35 Scale factor affects the origin (if no elevation map is given)
36
37 -c
38 Correct the coordinates to match the VTK-OpenGL precision
39
40 --overwrite
41 Allow output files to overwrite existing files
42
43 --help
44 Print usage summary
45
46 --verbose
47 Verbose module output
48
49 --quiet
50 Quiet module output
51
52 --ui
53 Force launching GUI dialog
54
55 Parameters:
56 input=name[,name,...]
57 Raster map(s) to be converted to VTK-ASCII data format
58
59 output=name
60 Name for VTK-ASCII output file
61
62 elevation=name
63 Name of input elevation raster map
64
65 null=float
66 Value to represent no data cell
67 Default: -99999.99
68
69 z=float
70 Constant elevation (if no elevation map is specified)
71 Default: 0.0
72
73 rgbmaps=string[,string,...]
74 Three (r,g,b) raster maps to create RGB values [redmap,green‐
75 map,bluemap]
76
77 vectormaps=string[,string,...]
78 Three (x,y,z) raster maps to create vector values [xmap,ymap,zmap]
79
80 zscale=float
81 Scale factor for elevation
82 Default: 1.0
83
84 precision=integer
85 Number of significant digits (floating point only)
86 Options: 0-20
87 Default: 12
88
90 Outputs raster maps in VTK-ASCII format. Map’s are valid raster map’s
91 in the current mapset. output is the name of an VTK-ASCII file which
92 will be written in the current working directory. If output is not
93 specified then stdout is used. The module is sensitive to region set‐
94 tings (set with g.region).
95
96 Elevation, scaling, point/celldata, vector and RGB Data are supported.
97 If the map is in LL projection, the elevation values will automatically
98 scaled to degrees. It is supposed that the elevation values are pro‐
99 vided in meters. If the elevation values are in a different unit than
100 meters, use the scale parameter to convert the units.
101
102 If no elevation map is given, the user can set the height of the map by
103 one value. Point or cell data are available. Also scaling is supported
104 for this elevation value. The elevation value must be provided in
105 meters.
106
107 The RGB input requires three raster maps: red, green, blue - in this
108 order. The maps must have values between 0 and 255, otherwise you will
109 get lots of warnings and the values are set to 0. More than one RGB
110 dataset (3 maps) is not supported.
111
112 The vector input requires three raster maps: x, y, z -- defining the
113 vector coordinates - in this order. More than one vector dataset (3
114 maps) is not supported.
115
117 This filter generates:
118
119 · structured points with celldata or pointdata if no elevation‐
120 file is given
121
122 · structured grid (not recommendet) with pointdata if an eleva‐
123 tionfile is given
124
125 · polydataset with pointdata if an elevationfile is given
126 (default)
127 and puts this in a simple VTK-ASCII file. Nor XML or binary output are
128 supported. It is possible to choose more then one raster map to be
129 written to the VTK-ASCII file. Each cell-/pointdata is named like the
130 raster map it represents. You can visualize this file with the VTK
131 Toolkit, Paraview and MayaVi which are based on VTK. If you have a
132 raster map with partly no data, use the threshold filter in paraview to
133 visualize the valid data. Just filter all data which is greater/lesser
134 than the chosen null value in the VTK-ASCII file.
135 If elevation map is chosen, a polygonal grid is created with quads, but
136 the user can choose also triangle strips or vertices. These datafor‐
137 mats a documented at VTK Toolkit.
138
139 If the "-c" flag is used and the data should be visualised together
140 with other data exported via *.out.vtk modules, be sure the "-c" flag
141 was also set in these modules. But this will only work with data from
142 the SAME location (The reference point for the coordinates transforma‐
143 tion is based on the center point of the default region).
144
145 Difference between point- and celldata
146 r.out.vtk can export raster cells with different representations.
147
148 · pointdata -- the cells/values are represented by the center of
149 the cell. Instead of cells, points are created. Each point can
150 hold different values, but the user can only visualize one
151 value at a time. These points can be connected in different
152 ways.
153
154 · celldata -- is only provided if no elevation map is given. The
155 cells are created with the same hight and width as in GRASS.
156 Each cell can hold different values, but the user can only
157 visualize one value at a time.
158
160 Simple Spearfish example
161 # set region
162 g.region n=4926970 s=4914857 w=591583 e=607793 res=50 -p
163 # export the data
164 r.out.vtk input=elevation.10m,slope,aspect elevation=elevation.10m output=/tmp/out.vtk
165 # visualize in Paraview or other VTK viewer:
166 paraview --data=/tmp/out.vtk
167
168 Spearfish example with RGB data
169 #set the region
170 g.region n=4926990 s=4914840 w=591570 e=607800 res=30 -p
171 # using r.in.wms to create RGB data to get a satellite coverage
172 r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
173 output=wms_global_mosaic
174 # export the data to VTK
175 r.out.vtk rgbmaps=wms_global_mosaic.red,wms_global_mosaic.green,wms_global_mosaic.blue \
176 elevation=elevation.10m output=/tmp/out.vtk
177 # visualize in Paraview or other VTK viewer:
178 paraview --data=/tmp/out.vtk
179 Paraview RGB visualization notes
180 To achieve proper RGB overlay:
181
182 · In Paraview, click "Apply"
183
184 · Select the "Display" tab and choose "Color by" to switch from
185 input scalars to rgb scalars
186
187 · Disable the "Map Scalars" check button in the display tab to
188 avoid the use of a lookup table
189
191 r3.out.vtk, r.out.ascii, g.region
192 GRASS and Paraview Wiki page
193
195 Soeren Gebbert
196
198 Available at: r.out.vtk source code (history)
199
200 Main index | Raster index | Topics index | Keywords index | Graphical
201 index | Full index
202
203 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
204
205
206
207GRASS 7.8.5 r.out.vtk(1)