-
Notifications
You must be signed in to change notification settings - Fork 0
/
us-iale2017.html
386 lines (321 loc) · 9.63 KB
/
us-iale2017.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<section>
<h2>3D rasters are powerful</h2>
<h3 style="margin-top: -0.5em">and you already know how to use them</h3>
<h3 style="margin-top: 0.5em">
Vaclav (Vashek) Petras,</h3>
<h4 style="margin-top: -0.7em">Anna Petrasova and Helena Mitasova
<p class="title-foot">
<a href="http://www.ncsu.edu/" title="North Carolina State University">NCSU</a>
<a href="http://geospatial.ncsu.edu/osgeorel/" title="NCSU GeoForAll Lab">GeoForAll Lab</a>
at the
<a href="http://geospatial.ncsu.edu/" title="Center for Geospatial Analytics">Center for Geospatial Analytics</a>
<br>
North Carolina State University
</p>
<p>
US-IALE, Baltimore<br>
April 9-13, 2017
</p>
</section>
<section>
<h2>3D rasters</h2>
<p>
Usage:
soil properties,
concentrations in water bodies,
properties of air mass,
hyperspectral data,
analysis of spatio-temporal data,
forest and habitat properties,
exploration of simulation scenario space,
etc.
</p>
<ul>
<li><strong>3D raster</strong> - Voxel space - 3D voxel grid - Voxel model
<li><strong>[3D] cell</strong> - Voxel - 3D voxel unit - Volumetric pixel
</ul>
<img src="img/raster3d_layout.png" class="stretch">
<p class="credit">
Image credit:
<a href="https://grass.osgeo.org/grass72/manuals/raster3dintro.html">GRASS Development Team</a>
</p>
</section>
<section>
<div class="left">
<h3>Series of 2D rasters</h3>
<ul>
<li>2D does not explicitly represent and model 3D relationships
<li>2D rasters accessible individually
</ul>
<img src="img/raster2d_series.png" style="width: 100%;">
</div>
<div class="right">
<h3>3D raster</h3>
<ul>
<li>explicit 3D relationships
<li>unified access to all 3 dimensions
<li>needs to be sliced to get 2D rasters
</ul>
<img src="img/raster3d_stack.png" style="width: 100%;">
</div>
</section>
<section>
<h3>Third dimension</h3>
<ul>
<li>The first two dimensions are the same as in 2D.
<li>Third dimension can be in space, time, or scenario space.
<li>Mind the possible anisotropy in the Z direction.
<br><small>(different from 2D rasters where all directions are isotropic most of the time)</small>
</ul>
<img src="img/axes.png" class="stretch">
</section>
<section>
<h2>Working with 3D rasters</h2>
Not that different from 2D rasters, images, and matrices
</section>
<section>
<h2>Python</h2>
<ul>
<li>using NumPy array
</ul>
<pre class="python" style="width: 50%;"><code>x = array([[[ 0, 1, 2],
[ 3, 4, 5],
[ 6, 7, 8]],
[[ 9, 10, 11],
[12, 13, 14],
[15, 16, 17]],
[[18, 19, 20],
[21, 22, 23],
[24, 25, 26]]])
x.sum(axis=0)
# array([[27, 30, 33],
# [36, 39, 42],
# [45, 48, 51]])
</code></pre>
<img src="img/logos/python.svg" class="stretch">
</section>
<section>
<h2>R</h2>
<ul>
<li>using array
</ul>
<pre class="r" style="width: 50%;"><code>x = array(1:40, dim=c(2,4,5))
# , , 1
#
# [,1] [,2] [,3] [,4]
# [1,] 1 3 5 7
# [2,] 2 4 6 8
#
# , , 2
# ...
x[2,3,3]
# 22
x[2,3,3] = 0
</code></pre>
<img src="img/logos/r.svg" class="stretch">
</section>
<section>
<h2>Octave</h2>
<ul>
<li>using 3D matrix/array
</ul>
<pre class="octave" style="width: 50%;"><code>x = reshape(1:8, 2, 2, 2)
a(2,1,1) = 5
b = 3 * a
# b =
#
# ans(:,:,1) =
#
# 3 9
# 15 12
</code></pre>
<img src="img/logos/octave.svg" class="stretch">
</section>
<section>
<h2>GRASS GIS</h2>
<p>
<em>general-purpose geospatial analysis and remote sensing tool</em>
</p>
<ul>
<li>
data types:
<ul>
<li>vectors
<li>2D rasters
<li><strong>3D rasters</strong>
</ul>
<li>
container types:
<ul>
<li>imagery groups
<ul>
<li><strong>series of 2D rasters</strong>
</ul>
<li>spatio-temporal datasets
<ul>
<li><strong>series of 2D rasters</strong>
<small>(or vectors or 3D rasters)</small>
</ul>
</ul>
</ul>
<br>
<img src="img/logos/grassgis.svg" class="stretch">
</section>
<section>
<h2>Moving window</h2>
<h3>2D</h3>
<pre class="bash" style="width: 100%;"><code>r.neighbors input=a output=b method=average size=5
r.colors map=b color=viridis
</code></pre>
<h3>3D</h3>
<pre class="bash" style="width: 100%;"><code>r3.neighbors input=a output=b method=average window=5,5,5
r3.colors map=b color=viridis
</code></pre>
</section>
<section>
<h2>3D raster algebra</h2>
Addition
<pre style="width: 55%;"><code>b = a + 2
</code></pre>
Conditional expression
<pre style="width: 55%;"><code>b = if(a > 20, 1, null())
</code></pre>
Accessing neighboring cells
<pre style="width: 55%;"><code>b = (a[0,0,-1] + a[0,0,1]) / 2
</code></pre>
</section>
<section>
<h2>Visual programming</h2>
<ul>
<li>graphical modeler
<li>graphical raster calculator
</ul>
<br>
<img src="img/graphical_modeler.png" class="stretch">
</section>
<section>
<h2>Example: Terrain evolution</h2>
<img src="img/jr_animation_2d.gif" class="stretch">
</section>
<section>
<h2>Example: Terrain evolution</h2>
<img src="img/jr16animation.gif" class="left">
<img src="img/jr20animation.gif" class="right">
<img src="img/raster3d_from_2d.png" class="stretch">
<p class="credit">
<small>
Image credit:
<a href="https://grass.osgeo.org/grass72/manuals/r.to.rast3.html">GRASS Development Team</a>
</small>
</p>
</section>
<section>
<h2>Example: Behavioral patterns</h2>
presence of people over time in camera view
<img src="img/amos_animation_2d.gif" class="stretch">
<p>
Petrasova A., Hipp, A.J., Mitasova, H.,
<em>Using space-time cube for visualization and analysis of active
transportation patterns derived from public webcams</em>.
ICC 2017, Washington DC 2-7th July
</p>
</section>
<section>
<h2>Example: Behavioral patterns</h2>
spatio-temporal data representing movement of people in urban environment
<br>
<img src="img/amos_animation_3d.gif" class="stretch">
<br>
Petrasova A., Hipp, A.J., Mitasova, H.,
<em>Using space-time cube for visualization and analysis of active
transportation patterns derived from public webcams</em>.
ICC 2017, Washington DC 2-7th July
</section>
<section>
<h2>Example: Vegetation structure</h2>
3D vegetation structure derived from lidar point clouds
<small class="glow">
Petras, V., D. J. Newcomb, and H. Mitasova.
<em>Generalized 3D fragmentation index derived from lidar point clouds.</em>
In: Open Geospatial Data, Software and Standards [in print]
</small>
<img src="img/fragmentation_paper.png" class="stretch box-glow">
<p class="credit">3D version of forest fragmentation index by Riitters et al.</p>
</section>
<section>
<h3>3D index of 3D raster</h3>
<img class="stretch" src="img/raster3d.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Point cloud</h3>
<img class="stretch" src="img/points3d.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Binning, moving window & raster algebra</h3>
<pre class="bash" style="width: 100%; font-size: 75% !important;"><code># Bash
r3.in.lidar input=points.las n=count base_raster=ground -d class_filter=3,4,5
r3.neighbors input=count output=average method=average window=3,3,3
r3.mapcalc expression="buffer = if(average > 0, 1, 0)"
</code></pre>
<img class="stretch" src="img/profile2d_presence.png">
<img style="width: 10%;" src="img/count_legend.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Fragmentation index</h3>
<pre class="python" style="width: 97%; font-size: 85% !important;"><code># Python
import grass.script as gs
gs.run_command("g.extension", extension="r3.forestfrag")
gs.run_command("r3.forestfrag", input="buffer", output="fragmentation")
</code></pre>
<!-- stretch does not work well here -->
<img style="width: 100%; margin-bottom: 0em;" src="img/profile2d_ff.png">
<br>
<img style="width: 20%; margin-top: 0em;" src="img/ff_legend.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Profile of 3D raster</h3>
<img class="stretch" src="img/profiles3d.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Back to 2D</h3>
<img style="width: 20%;" src="img/count_categories.png">
<pre class="bash" style="width: 75%; font-size: 80% !important;"><code># Bash
g.extension r3.count.categories
r3.count.categories input=fragmentation output=count
g.list type=raster pattern="count_*"
</code></pre>
<img class="stretch" src="img/relative_count.png">
<p class="credit">Petras et al. 2017 [in print]</p>
</section>
<section>
<h3>Conclusion</h3>
<ul>
<li>there is a third dimension
<li>3D rasters can handle it
<li>use the tool you know, or pick one
</ul>
<p style="text-align: left; width: 40%; margin-left: auto; margin-right: auto;">
<img src="img/logos/grassgis.svg" style="width: 10%; vertical-align: middle;">
GRASS GIS
<a href="http://grass.osgeo.org">grass.osgeo.org</a>
<br>
<img src="img/logos/python.svg" style="width: 10%; vertical-align: middle;">
Python
<a href="http://python.org">python.org</a>
<br>
<img src="img/logos/r.svg" style="width: 10%; vertical-align: middle;">
R
<a href="https://www.r-project.org/">r-project.org</a>
<br>
<img src="img/logos/octave.svg" style="width: 10%; vertical-align: middle;">
Octave
<a href="https://www.gnu.org/software/octave/">octave.org</a>
</p>
<p>
<a href="https://github.com/wenzeslaus">github.com/wenzeslaus</a>
</section>