Browse Source

New t.vect.extract test and several command line option fixes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51674 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 years ago
parent
commit
c900a70509

+ 1 - 0
temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py

@@ -54,6 +54,7 @@
 #%end
 
 #%option G_OPT_R_BASE
+#% gisprompt: 
 #%end
 
 #%flag

+ 1 - 0
temporal/t.rast.aggregate/t.rast.aggregate.py

@@ -56,6 +56,7 @@
 #%end
 
 #%option G_OPT_R_BASE
+#% gisprompt: 
 #%end
 
 #%flag

+ 1 - 3
temporal/t.rast.export/t.rast.export.py

@@ -27,12 +27,10 @@
 #% description: Name of a space time raster dataset archive
 #%end
 
-#%option
+#%option G_OPT_M_DIR
 #% key: workdir
-#% type: string
 #% description: Path to the work directory, default is /tmp
 #% required: no
-#% multiple: no
 #% answer: /tmp
 #%end
 

+ 1 - 0
temporal/t.rast.extract/t.rast.extract.py

@@ -38,6 +38,7 @@
 #%end
 
 #%option G_OPT_R_BASE
+#% gisprompt: 
 #%end
 
 #%option

+ 1 - 0
temporal/t.rast.mapcalc/t.rast.mapcalc.py

@@ -43,6 +43,7 @@
 #% key: base
 #% type: string
 #% description: The base name of the new created raster maps. This name will be extended with a numerical prefix
+#% gisprompt: NULL
 #% required: yes
 #% multiple: no
 #%end

+ 45 - 0
temporal/t.vect.extract/test.t.vect.extract.layer.sh

@@ -0,0 +1,45 @@
+# Test the temporal and spatial sampling of raster maps by vector point maps
+# We need to set a specific region in the
+# @preprocess step of this test. 
+# The region setting should work for UTM and LL test locations
+g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
+
+r.mapcalc --o expr="prec_1 = 100.0"
+r.mapcalc --o expr="prec_2 = 200.0"
+r.mapcalc --o expr="prec_3 = 300"
+r.mapcalc --o expr="prec_4 = 400"
+r.mapcalc --o expr="prec_5 = 500.0"
+r.mapcalc --o expr="prec_6 = 600.0"
+
+v.random --o -z output=prec n=5 seed=1
+
+t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
+t.register -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-03-01 00:00:00" increment="1 months"
+
+# The @test
+t.vect.observe.strds input=prec strds=precip_abs1 output=prec_observer column=prec
+v.info prec_observer
+t.info type=stvds input=prec_observer
+t.vect.list input=prec_observer
+
+t.vect.extract --o input=prec_observer output=test_extract_1 base=test_1
+t.info type=stvds input=test_extract_1
+t.vect.univar input=test_extract_1 column=prec 
+t.vect.extract --o input=prec_observer expr="prec > 400" output=test_extract_2 base=test_2
+t.info type=stvds input=test_extract_2
+t.vect.univar input=test_extract_2 column=prec 
+t.vect.extract --o input=prec_observer where="start_time >= '2001-05-01'" expr="prec > 400" output=test_extract_3 base=test_3
+t.info type=stvds input=test_extract_3
+t.vect.univar input=test_extract_3 column=prec 
+
+
+
+# @postprocess
+t.unregister type=rast maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
+t.remove type=strds input=precip_abs1
+t.remove type=stvds input=prec_observer,test_extract_1,test_extract_2,test_extract_3
+t.unregister type=vect maps=prec_observer:1,prec_observer:2,prec_observer:3,prec_observer:4,prec_observer:5,prec_observer:6
+
+g.remove vect=prec_observer
+g.mremove -f vect=test_*
+g.remove rast=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6

+ 1 - 5
temporal/t.vect.observe.strds/t.vect.observe.strds.py

@@ -23,12 +23,8 @@
 #%option G_OPT_STVDS_INPUT
 #%end
 
-#%option
+#%option G_OPT_STRDS_INPUT
 #% key: strds
-#% type: string
-#% description: The space time raster dataset to use
-#% required: yes
-#% multiple: no
 #%end
 
 #%option

+ 0 - 1
temporal/t.vect.observe.strds/test.t.vect.observe.strds.sh

@@ -21,7 +21,6 @@ t.vect.observe.strds input=prec strds=precip_abs1 output=prec_observer
 v.info prec_observer
 t.info type=stvds input=prec_observer
 t.vect.list input=prec_observer
-t.vect.extract input=prec_observer where="start_time >= '2001-05-01'" expr="prec > 400" output=test_extract base=test_
 
 # @postprocess
 t.unregister type=rast maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6

+ 1 - 1
temporal/t.vect.what.strds/t.vect.what.strds.py

@@ -23,7 +23,7 @@
 #%option G_OPT_STVDS_INPUT
 #%end
 
-#%option  G_OPT_STRDS_INPUT
+#%option G_OPT_STRDS_INPUT
 #% key: strds
 #%end