[GRASS-SVN] r62616 - in grass/trunk/temporal/t.unregister: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 5 06:06:26 PST 2014


Author: huhabla
Date: 2014-11-05 06:06:26 -0800 (Wed, 05 Nov 2014)
New Revision: 62616

Modified:
   grass/trunk/temporal/t.unregister/t.unregister.html
   grass/trunk/temporal/t.unregister/t.unregister.py
   grass/trunk/temporal/t.unregister/testsuite/test_unregister.py
Log:
temporal modules: Improved description of t.unregister


Modified: grass/trunk/temporal/t.unregister/t.unregister.html
===================================================================
--- grass/trunk/temporal/t.unregister/t.unregister.html	2014-11-05 13:58:06 UTC (rev 62615)
+++ grass/trunk/temporal/t.unregister/t.unregister.html	2014-11-05 14:06:26 UTC (rev 62616)
@@ -14,41 +14,47 @@
 
 Specification of map names:
 <div class="code"><pre>
-prec_1
-prec_2
-prec_3
-prec_4
-prec_5
-prec_6
+a1
+a2
+a3
+a4
+a5
+a6
 </pre></div>
 
+<h3>NOTE</h3>
+In case the <em>input</em> option is used to specify a space time dataset
+the maps are only unregistered from the space time dataset, but not from the
+temporal database. The reason is that maps can be registered in 
+multiple space time datasets and there is a need to 
+unregister them from a specific STDS without affecting other STDS.
+
 <h2>EXAMPLE</h2>
 
 In this example we create 2 raster map layers that will be registered 
-in a space time raster dataset named <em>precip_abs</em> using a 
+in a space time raster dataset named <em>A</em> using a 
 monthly temporal granularity. We use t.unregister to unregister a map 
 layer from the space time dataset and from the temporal database.
 
 <div class="code"><pre>
-r.mapcalc expr="prec_1 = 100"
-r.mapcalc expr="prec_2 = 200"
-r.mapcalc expr="prec_3 = 300"
+r.mapcalc expr="a1 = 100"
+r.mapcalc expr="a2 = 200"
 
 t.create type=strds temporaltype=absolute \
-    output=precip_abs title="Example" \
+    output=A title="Example" \
     descr="Example"
 
-t.register -i type=rast input=precip_abs \
-    maps=prec_1,prec_2,prec_3 \
+t.register -i type=rast input=A \
+    maps=a1,a2 \
     start="2001-01-01" increment="1 month"
 
-# We unregister raster map prec_1 from a space time dataset,
-# the raster map is still present in the temporal database
-t.unregister type=rast input=precip_abs maps=prec_1
+# We unregister raster maps a1 and a2 from a space time dataset,
+# the raster maps are still present in the temporal database
+t.unregister type=rast input=A maps=a1,a2
 
-# We unregister raster map prec_2 from the temporal database, hence
-# the time stamp is removed
-t.unregister type=rast maps=prec_2
+# We unregister raster map a1 and a2 from the temporal database, hence
+# the time stamps are removed
+t.unregister type=rast maps=a1,a2
 </pre></div>
 
 

Modified: grass/trunk/temporal/t.unregister/t.unregister.py
===================================================================
--- grass/trunk/temporal/t.unregister/t.unregister.py	2014-11-05 13:58:06 UTC (rev 62615)
+++ grass/trunk/temporal/t.unregister/t.unregister.py	2014-11-05 14:06:26 UTC (rev 62616)
@@ -151,8 +151,12 @@
     grass.percent(num_maps, num_maps, 1)
 
     # Update space time datasets
-    grass.message(_("Unregister maps from space time dataset(s)"))
     if input:
+        grass.message(_("Unregister maps from space time dataset <%s>"%(input)))
+    else:
+        grass.message(_("Unregister maps from the temporal database"))
+
+    if input:
         sp.update_from_registered_maps(dbif)
         sp.update_command_string(dbif=dbif)
     elif len(update_dict) > 0:

Modified: grass/trunk/temporal/t.unregister/testsuite/test_unregister.py
===================================================================
--- grass/trunk/temporal/t.unregister/testsuite/test_unregister.py	2014-11-05 13:58:06 UTC (rev 62615)
+++ grass/trunk/temporal/t.unregister/testsuite/test_unregister.py	2014-11-05 14:06:26 UTC (rev 62616)
@@ -17,7 +17,7 @@
 
     @classmethod
     def setUpClass(cls):
-        """!Initiate the temporal GIS and set the region
+        """Initiate the temporal GIS and set the region
         """
         tgis.init()
         cls.use_temp_region()



More information about the grass-commit mailing list