1t.sample(1)                 GRASS GIS User's Manual                t.sample(1)
2
3
4

NAME

6       t.sample  - Samples the input space time dataset(s) with a sample space
7       time dataset and print the result to stdout.
8

KEYWORDS

10       temporal, sampling, time
11

SYNOPSIS

13       t.sample
14       t.sample --help
15       t.sample  [-cs]   inputs=name[,name,...]   sample=name    [intype=name]
16       [samtype=name]      [method=name[,name,...]]      [separator=character]
17       [--help]  [--verbose]  [--quiet]  [--ui]
18
19   Flags:
20       -c
21           Print the column names as first row
22
23       -s
24           Check for spatial topological overlap
25
26       --help
27           Print usage summary
28
29       --verbose
30           Verbose module output
31
32       --quiet
33           Quiet module output
34
35       --ui
36           Force launching GUI dialog
37
38   Parameters:
39       inputs=name[,name,...] [required]
40           Name of the input space time datasets
41
42       sample=name [required]
43           Name of the sample space time dataset
44
45       intype=name
46           Type of the input space time dataset
47           Options: strds, stvds, str3ds
48           Default: strds
49
50       samtype=name
51           Type of the sample space time dataset
52           Options: strds, stvds, str3ds
53           Default: strds
54
55       method=name[,name,...]
56           The method to be used for sampling the input dataset
57           Options: start, during, overlap, contain, equal, follows, precedes
58           Default: during,overlap,contain,equal
59
60       separator=character
61           Do not use "," as this char is reserved to list several map ids  in
62           a sample granule
63           Field separator between output columns, default is tabular " | "
64           Default: pipe
65

DESCRIPTION

67       The  purpose  of  this module is to compute and to show spatio-temporal
68       relations between space time datasets of different type. Several  input
69       space  time  datasets  are sampled by a sample space time dataset using
70       temporal topological relations. The  types  of  the  input  space  time
71       datasets  and  the type of the sample space time dataset can be differ‐
72       ent.
73
74       This module is useful to analyze temporal relationships  between  space
75       time  datasets  using  temporal  topology.  The  flag -s enables a spa‐
76       tio-temporal topology, so that only spatio-temporal related map  layers
77       of space time datasets are considered in the analysis.
78

NOTES

80       The  temporal  relation start means that the start time of an input map
81       layer is temporally located in an interval of a sample map layer.
82
83       The textual output at the command line shows the  names  of  the  maps,
84       start  and end time as well as the interval length in days and the tem‐
85       poral distance from begin in days.
86
87       The default separator is the pipe symbol.
88
89       Temporal gaps, if  present,  in  the  input  and  sampling  space  time
90       datasets  will  be used in the sampling process. Gaps have no map name,
91       instead None is printed.
92

EXAMPLE

94       In the examples below we create a space time raster  dataset  A  and  a
95       space  time  vector  dataset P that have different temporal layouts and
96       number of map layers. The space time vector  dataset  contains  a  gap,
97       that will be used in the sampling process.
98
99       We  use  t.sample to inspect the topological relations between the time
100       stamped map layers in A and P.
101
102       # Set an appropriate region
103       g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
104       # Generate the raster map layer
105       r.mapcalc expression="a1 = rand(0, 550)" -s
106       r.mapcalc expression="a2 = rand(0, 450)" -s
107       r.mapcalc expression="a3 = rand(0, 320)" -s
108       r.mapcalc expression="a4 = rand(0, 510)" -s
109       r.mapcalc expression="a5 = rand(0, 300)" -s
110       r.mapcalc expression="a6 = rand(0, 650)" -s
111       # Generate the vector map layer
112       v.random -z output=pnts1 n=20 zmin=0 zmax=100 column=height
113       v.random -z output=pnts2 n=20 zmin=0 zmax=100 column=height
114       n1=`g.tempfile pid=1 -d`
115       n2=`g.tempfile pid=2 -d`
116       cat > "${n1}" << EOF
117       a1
118       a2
119       a3
120       a4
121       a5
122       a6
123       EOF
124       cat > "${n2}" << EOF
125       pnts1|2001-01-01|2001-03-01
126       pnts2|2001-05-01|2001-07-01
127       EOF
128       # Register the maps in new space time datasets
129       t.create type=strds temporaltype=absolute output=A \
130           title="A test with raster input files" descr="A test with raster input files"
131       t.create type=stvds temporaltype=absolute output=P \
132           title="A test with vector input files" descr="A test with vector input files"
133       t.register type=raster -i input=A file="${n1}" start="2001-01-01" increment="1 months"
134       # Raster map layer in A
135       t.rast.list A
136       name|mapset|start_time|end_time
137       a1|PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00
138       a2|PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00
139       a3|PERMANENT|2001-03-01 00:00:00|2001-04-01 00:00:00
140       a4|PERMANENT|2001-04-01 00:00:00|2001-05-01 00:00:00
141       a5|PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00
142       a6|PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00
143       t.register type=vector input=P file="${n2}"
144       # Vector map layer in P
145       t.vect.list P
146       name|layer|mapset|start_time|end_time
147       pnts1|None|PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00
148       pnts2|None|PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00
149       # Start time of maps in A located in maps in P
150       t.sample method=start input=A samtype=stvds sample=P -c
151       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
152       pnts1@PERMANENT|a1@PERMANENT,a2@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
153       None|a3@PERMANENT,a4@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
154       pnts2@PERMANENT|a5@PERMANENT,a6@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
155       # P contains A
156       t.sample method=contain input=A samtype=stvds sample=P -c
157       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
158       pnts1@PERMANENT|a1@PERMANENT,a2@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
159       None|a3@PERMANENT,a4@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
160       pnts2@PERMANENT|a5@PERMANENT,a6@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
161       # A during P
162       t.sample method=during intype=stvds input=P samtype=strds sample=A -c
163       A@PERMANENT|P@PERMANENT|start_time|end_time|interval_length|distance_from_begin
164       a1@PERMANENT|pnts1@PERMANENT|2001-01-01 00:00:00|2001-02-01 00:00:00|31.0|0.0
165       a2@PERMANENT|pnts1@PERMANENT|2001-02-01 00:00:00|2001-03-01 00:00:00|28.0|31.0
166       a3@PERMANENT|None|2001-03-01 00:00:00|2001-04-01 00:00:00|31.0|59.0
167       a4@PERMANENT|None|2001-04-01 00:00:00|2001-05-01 00:00:00|30.0|90.0
168       a5@PERMANENT|pnts2@PERMANENT|2001-05-01 00:00:00|2001-06-01 00:00:00|31.0|120.0
169       a6@PERMANENT|pnts2@PERMANENT|2001-06-01 00:00:00|2001-07-01 00:00:00|30.0|151.0
170       # No Overlapping
171       t.sample method=overlap input=A samtype=stvds sample=P -cs
172       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
173       pnts1@PERMANENT|None|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
174       None|None|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
175       pnts2@PERMANENT|None|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
176       t.sample method=precedes input=A samtype=stvds sample=P -c
177       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
178       pnts1@PERMANENT|a3@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
179       None|a5@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
180       pnts2@PERMANENT|None|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
181       t.sample method=follows  input=A samtype=stvds sample=P -c
182       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
183       pnts1@PERMANENT|None|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
184       None|a2@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
185       pnts2@PERMANENT|a4@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
186       t.sample method=precedes,follows input=A samtype=stvds sample=P -c
187       P@PERMANENT|A@PERMANENT|start_time|end_time|interval_length|distance_from_begin
188       pnts1@PERMANENT|a3@PERMANENT|2001-01-01 00:00:00|2001-03-01 00:00:00|59.0|0.0
189       None|a5@PERMANENT,a2@PERMANENT|2001-03-01 00:00:00|2001-05-01 00:00:00|61.0|59.0
190       pnts2@PERMANENT|a4@PERMANENT|2001-05-01 00:00:00|2001-07-01 00:00:00|61.0|120.0
191

SEE ALSO

193        t.create, t.info
194

AUTHOR

196       Sören Gebbert, Thünen Institute of Climate-Smart Agriculture
197

SOURCE CODE

199       Available at: t.sample source code (history)
200
201       Main index | Temporal index | Topics index | Keywords index | Graphical
202       index | Full index
203
204       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
205
206
207
208GRASS 7.8.5                                                        t.sample(1)
Impressum