1#!/bin/sh
2# This is a test to register and unregister raster maps in
3# space time raster datasets.
4# The raster maps will be registered in different space time raster
5# datasets.
6
7# We need to set a specific region in the
8# @preprocess step of this test. We generate
9# raster with r.mapcalc and create several space time raster datasets
10# with absolute time
11# The region setting should work for UTM and LL test locations
12g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
13
14# Generate data
15r.mapcalc --o expr="prec_1 = rand(0, 550)" -s
16r.mapcalc --o expr="prec_2 = rand(0, 450)" -s
17r.mapcalc --o expr="prec_3 = rand(0, 320)" -s
18r.mapcalc --o expr="prec_4 = rand(0, 510)" -s
19
20r.timestamp map=prec_1 date="1 jan 1995 / 23 sep 1995"
21r.timestamp map=prec_2 date="14 jul 1996 / 15 jul 1996"
22r.timestamp map=prec_3 date="1 mar 1998"
23r.timestamp map=prec_4 date="17 mar 1950 / 28 apr 1960"
24
25# The first @test
26# We create the space time raster inputs and register the raster maps with absolute time interval
27
28t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
29
30t.register --o -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4
31t.info type=strds input=precip_abs1
32t.info -g type=strds input=precip_abs1
33r.info map=prec_1
34t.rast.list input=precip_abs1
35t.topology input=precip_abs1
36
37# Test the warning message
38t.remove -rf type=strds input=precip_abs1
39