3
The purpose of this module is to compute and to show spatio-temporal
4
relations between space time datasets of different type. Several input
5
space time datasets are sampled by a <em>sample</em> space time dataset
6
using temporal topological relations. The types of the input space time
7
datasets and the type of the sample space time dataset can be
10
This module is useful to analyze temporal relationships between space
11
time datasets using temporal topology. The flag <em>-s</em> enables a
12
spatio-temporal topology, so that only spatio-temporal related map
13
layers of space time datasets are considered in the analysis.
17
The temporal relation <em>start</em> means that the start time of an
18
input map layer is temporally located in an interval of a sample map
21
The textual output at the command line shows the names of the maps,
22
start and end time as well as the <em>interval length</em> in days and
23
the temporal <em>distance from begin</em> in days.
25
The default <em>separator</em> is the pipe symbol.
27
Temporal gaps, if present, in the input and sampling space time
28
datasets will be used in the sampling process. Gaps have no map name,
29
instead <em>None</em> is printed.
33
In the examples below we create a space time raster dataset <em>A</em>
34
and a space time vector dataset <em>P</em> that have different temporal
35
layouts and number of map layers. The space time vector dataset
36
contains a gap, that will be used in the sampling process.
38
We use <em>t.sample</em> to inspect the topological relations between the
39
time stamped map layers in <em>A</em> and <em>P</em>.
41
<div class="code"><pre>
42
# Set an appropriate region
43
g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
45
# Generate the raster map layer
46
r.mapcalc expr="a1 = rand(0, 550)" -s
47
r.mapcalc expr="a2 = rand(0, 450)" -s
48
r.mapcalc expr="a3 = rand(0, 320)" -s
49
r.mapcalc expr="a4 = rand(0, 510)" -s
50
r.mapcalc expr="a5 = rand(0, 300)" -s
51
r.mapcalc expr="a6 = rand(0, 650)" -s
53
# Generate the vector map layer
54
v.random -z output=pnts1 n=20 zmin=0 zmax=100 column=height
55
v.random -z output=pnts2 n=20 zmin=0 zmax=100 column=height
57
n1=`g.tempfile pid=1 -d`
58
n2=`g.tempfile pid=2 -d`
70
pnts1|2001-01-01|2001-03-01
71
pnts2|2001-05-01|2001-07-01
74
# Register the maps in new space time datasets
75
t.create type=strds temporaltype=absolute output=A \
76
title="A test with raster input files" descr="A test with raster input files"
78
t.create type=stvds temporaltype=absolute output=P \
79
title="A test with vector input files" descr="A test with vector input files"
81
t.register type=raster -i input=A file="${n1}" start="2001-01-01" increment="1 months"
83
# Raster map layer in A
86
name|mapset|start_time|end_time
87
a1|PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00
88
a2|PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00
89
a3|PERMANENT|2001-03-01 00:00:00|2001-04-01 00:00:00
90
a4|PERMANENT|2001-04-01 00:00:00|2001-05-01 00:00:00
91
a5|PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00
92
a6|PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00
95
t.register type=vector input=P file="${n2}"
97
# Vector map layer in P
100
name|layer|mapset|start_time|end_time
101
pnts1|None|PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00
102
pnts2|None|PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00
104
# Start time of maps in A located in maps in P
105
t.sample method=start input=A samtype=stvds sample=P -c
107
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
108
pnts1@PERMANENT|a1@PERMANENT,a2@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
109
None|a3@PERMANENT,a4@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
110
pnts2@PERMANENT|a5@PERMANENT,a6@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
114
t.sample method=contain input=A samtype=stvds sample=P -c
116
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
117
pnts1@PERMANENT|a1@PERMANENT,a2@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
118
None|a3@PERMANENT,a4@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
119
pnts2@PERMANENT|a5@PERMANENT,a6@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
123
t.sample method=during intype=stvds input=P samtype=strds sample=A -c
125
A@PERMANENT|P@PERMANENT|start_time|end_time|interval_length|distance_from_begin
126
a1@PERMANENT|pnts1@PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00|31.0|0.0
127
a2@PERMANENT|pnts1@PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00|28.0|31.0
128
a3@PERMANENT|None|2001-03-01 00:00:00|2001-04-01 00:00:00|31.0|59.0
129
a4@PERMANENT|None|2001-04-01 00:00:00|2001-05-01 00:00:00|30.0|90.0
130
a5@PERMANENT|pnts2@PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00|31.0|120.0
131
a6@PERMANENT|pnts2@PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00|30.0|151.0
135
t.sample method=overlap input=A samtype=stvds sample=P -cs
137
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
138
pnts1@PERMANENT|None|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
139
None|None|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
140
pnts2@PERMANENT|None|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
143
t.sample method=precedes input=A samtype=stvds sample=P -c
145
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
146
pnts1@PERMANENT|a3@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
147
None|a5@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
148
pnts2@PERMANENT|None|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
151
t.sample method=follows input=A samtype=stvds sample=P -c
153
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
154
pnts1@PERMANENT|None|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
155
None|a2@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
156
pnts2@PERMANENT|a4@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
159
t.sample method=precedes,follows input=A samtype=stvds sample=P -c
161
P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
162
pnts1@PERMANENT|a3@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
163
None|a5@PERMANENT,a2@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
164
pnts2@PERMANENT|a4@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
170
<a href="t.create.html">t.create</a>,
171
<a href="t.info.html">t.info</a>
176
Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
178
<p><i>Last changed: $Date: 2014-12-29 09:56:42 +0100 (Mon, 29 Dec 2014) $</i>