~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to raster3d/r3.out.vtk/description.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<h2>DESCRIPTION</h2>
2
 
 
3
 
The module <em>r3.out.vtk</em> outputs 3D raster maps into VTK-ASCII format.
4
 
Maps are valid 3D raster maps in the current mapset search path. The
5
 
<em>output</em> parameter is the name of a VTK-ASCII file which will be
6
 
written in the current working directory. If <em>output</em> is not
7
 
specified then standard output (stdout) is used. The module is sensitive
8
 
to region settings (set with <em>g.region</em>).
9
 
 
10
 
<h2>NOTES</h2>
11
 
 
12
 
This module generates <i>structured points</i> with <i>celldata</i> 
13
 
(default) or <i>pointdata</i>. If top and bottom surfaces are requested
14
 
an <i>unstructured grid</i> with <i>celldata</i> or a <i>structured grid</i>
15
 
with <i>pointdata</i> is generated.
16
 
This data is put in a simple VTK-ASCII file. Neither XML nor 
17
 
binary output are supported. It is possible to choose more then one 3D raster
18
 
map
19
 
to be written in the VTK-ASCII file. Each <i>celldata</i> is named as the
20
 
3D raster map it represents. The user can visualize this file with the 
21
 
<em><a href="http://www.vtk.org">VTK Toolkit</a></em>, 
22
 
<em><a href="http://www.paraview.org">ParaView</a></em> and 
23
 
<em><a href="http://mayavi.sourceforge.net">MayaVi</a></em> which are based on
24
 
VTK. In case of 3D raster map with partially no data, the threshold filter in
25
 
ParaView can be used to visualize the valid data. Just filter all data which is
26
 
greater/lesser than the chosen null value in the VTK-ASCII file.
27
 
 
28
 
<p>
29
 
The top and bottom region values are expected in meters. 
30
 
If a Latitude-Longitude (LL) coordinates are used, the elevation value for each
31
 
voxel will be converted into degrees.
32
 
 
33
 
<p>
34
 
The <em>input</em>, <em>rgbmaps</em> and <em>vectormaps</em> parameters are
35
 
optional, so only the geometry can be exported.
36
 
 
37
 
<p>
38
 
If the user defines <em>top</em> and <em>bottom</em> and the 2D and 3D region
39
 
values differ, the 2D resolution will be adjusted to the 3D resolution. The
40
 
elevation maps are expected in meters. If Lat/Long coordinates are used, the
41
 
elevation will automatically converted into degree.
42
 
If the surface and bottom maps are in a different unit than meters, use the
43
 
scale parameter to convert them into meters.
44
 
 
45
 
<p>
46
 
The RGB voxel data can be created from 2D raster maps (Landsat TM images) 
47
 
with <em><a href="r.to.rast3.html">r.to.rast3</a></em>. The values of the RGB maps
48
 
must be within 0 and 255. If not, the values are automatically set
49
 
to 0 and warnings will be printed to stderr.
50
 
 
51
 
<p>
52
 
The vector data is created from three 3D raster maps. Each map represents a vector component.
53
 
So x, y and z components are required in this order. This data can be visualized with Glyph3d or 
54
 
StreamTracer filters within Paraview.
55
 
 
56
 
<p>
57
 
If the <em>-c</em> flag is used and the data should be visualised together with
58
 
other data exported via <em>*.out.vtk</em> modules, be sure the <em>-c</em> flag
59
 
was also set in these modules. But this will only work with data from the SAME
60
 
location (the reference point for the coordinates transformation is based on the
61
 
center point of the default region).
62
 
 
63
 
<h3>Difference between point- and celldata</h3>
64
 
 
65
 
<em>r3.out.vtk</em> can export 3D raster maps with different representations.
66
 
<ul>
67
 
<li> <em>pointdata</em> -- the cells/values are represented by the center of the
68
 
cell. Instead of cells, points are created. Each point can hold different
69
 
values, but the user can only visualize one value at a time.</li>
70
 
<li> <em>celldata</em> The cells are created with the same hight, width and depth
71
 
as in GRASS. Each cell can hold different values, but the user can only
72
 
visualize one value at a time.</li>
73
 
</ul>
74
 
 
75
 
<h2>EXAMPLE</h2>
76
 
 
77
 
<h3>Simple Spearfish example</h3>
78
 
 
79
 
<div class="code"><pre>
80
 
g.region -d
81
 
g.region res=150 res3=150 t=80 b=0 tbres=10
82
 
r.mapcalc "bottom = 1800. - elevation.10m"
83
 
 
84
 
# synthetic data, could be geological structures:
85
 
r3.mapcalc "map3d = row()+col()+depth()"
86
 
 
87
 
#export of volume to VTK:
88
 
r3.out.vtk -s input=map3d top=elevation.10m bottom=bottom output=/tmp/out.vtk
89
 
 
90
 
# visualize in paraview or other VTK viewer:
91
 
paraview --data=/tmp/out.vtk
92
 
</pre></div>
93
 
 
94
 
<h3>Spearfish example with RGB data</h3>
95
 
 
96
 
<div class="code"><pre>
97
 
#set the region
98
 
g.region -d
99
 
g.region n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80 b=0 tbres=10
100
 
 
101
 
#create a bottom surface
102
 
r.mapcalc "bottom = 1800. - elevation.10m"
103
 
 
104
 
# synthetic data, could be geological structures:
105
 
r3.mapcalc "map3d = row()+col()+depth()"
106
 
 
107
 
#get some satellite images with r.in.onearth
108
 
r.in.onearth -l output=Sat tmband=Red
109
 
r.in.onearth -l output=Sat tmband=IR1
110
 
r.in.onearth -l output=Sat tmband=IR2
111
 
 
112
 
#Convert the 2d maps to 3d raster maps with r.to.rast3
113
 
r.to.rast3 input=SatLandsatTM_Red output=SatLandsatTM_Red
114
 
r.to.rast3 input=SatLandsatTM_IR1 output=SatLandsatTM_IR1
115
 
r.to.rast3 input=SatLandsatTM_IR2 output=SatLandsatTM_IR2
116
 
 
117
 
#export of volume to VTK:
118
 
r3.out.vtk -s rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLandsatTM_Red
119
 
input=map3d top=elevation.10m bottom=bottom output=/tmp/out.vtk
120
 
 
121
 
# visualize in paraview or other VTK viewer:
122
 
paraview --data=/tmp/out.vtk 
123
 
</pre></div>
124
 
 
125
 
<h3>Spearfish example with vector data</h3>
126
 
 
127
 
<div class="code"><pre>
128
 
# set the region
129
 
g.region -d
130
 
g.region n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80 b=0 tbres=10
131
 
 
132
 
# create a bottom surface
133
 
r.mapcalc "bottom = 1800. - elevation.10m"
134
 
 
135
 
# synthetic data, could be geological structures:
136
 
r3.mapcalc "map3d = row()+col()+depth()"
137
 
 
138
 
# synthetic vector data, could be groundwater stream vectors
139
 
r3.mapcalc "x_part = sin(row())"
140
 
r3.mapcalc "y_part = cos(col())"
141
 
r3.mapcalc "z_part = sin(depth())"
142
 
 
143
 
 
144
 
# export the stuff data to VTK:
145
 
r3.out.vtk -s vectormaps=x_part,y_part,z_part input=map3d top=elevation.10m
146
 
bottom=bottom output=/tmp/out.vtk
147
 
 
148
 
# visualize in paraview or other VTK viewer:
149
 
paraview --data=/tmp/out.vtk 
150
 
# Now use the Glyph and Stream-Trace Filter to get nice vectors and streamlines
151
 
</pre></div>
152
 
 
153
 
 
154
 
<h3>Slovakia3d example</h3>
155
 
 
156
 
<div class="code"><pre>
157
 
#reduce resolution:
158
 
g.region -dp3 res=1000 res3=1000
159
 
r.mapcalc "bottom = 100"
160
 
 
161
 
#export of volume to VTK:
162
 
r3.out.vtk -s in=precip3d.500z50 top=dem500 bottom=bottom
163
 
out=/tmp/slovakia3d.vtk
164
 
 
165
 
# visualize in paraview or other VTK viewer:
166
 
paraview --data=/tmp/slovakia3d.vtk
167
 
# set Display style to 'surface#
168
 
# set Actor Control z to 10
169
 
</pre></div>
170
 
 
171
 
<h2>SEE ALSO</h2>
172
 
 
173
 
<em>
174
 
<a href="r.out.vtk.html">r.out.vtk</a>,
175
 
<a href="r3.out.ascii.html">r3.out.ascii</a>,
176
 
<a href="g.region.html">g.region</a>
177
 
</em>
178
 
 
179
 
<h2>AUTHOR</h2>
180
 
S&ouml;ren Gebbert
181
 
 
182
 
<p><i>Last changed: $Date: 2011-09-13 22:13:36 +0200 (Tue, 13 Sep 2011) $</i>