Pārlūkot izejas kodu

temporal modules: Improved description of t.unregister

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62616 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 10 gadi atpakaļ
vecāks
revīzija
403d5aedc5

+ 25 - 19
temporal/t.unregister/t.unregister.html

@@ -14,41 +14,47 @@ be used to specify 3d raster or vector map layer types.
 
 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>
 
 

+ 5 - 1
temporal/t.unregister/t.unregister.py

@@ -151,7 +151,11 @@ def main():
     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)

+ 1 - 1
temporal/t.unregister/testsuite/test_unregister.py

@@ -17,7 +17,7 @@ class TestUnregister(TestCase):
 
     @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()