[GRASS-SVN] r53083 - in grass/trunk: lib/python/temporal temporal/t.vect.observe.strds temporal/t.vect.univar temporal/t.vect.what.strds

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 4 06:48:24 PDT 2012


Author: huhabla
Date: 2012-09-04 06:48:24 -0700 (Tue, 04 Sep 2012)
New Revision: 53083

Modified:
   grass/trunk/lib/python/temporal/space_time_datasets_tools.py
   grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
   grass/trunk/temporal/t.vect.univar/t.vect.univar.py
   grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py
Log:
Affected space time datasets will be updated in case time stamps are changed for registered maps.


Modified: grass/trunk/lib/python/temporal/space_time_datasets_tools.py
===================================================================
--- grass/trunk/lib/python/temporal/space_time_datasets_tools.py	2012-09-04 12:00:51 UTC (rev 53082)
+++ grass/trunk/lib/python/temporal/space_time_datasets_tools.py	2012-09-04 13:48:24 UTC (rev 53083)
@@ -176,6 +176,8 @@
     num_maps = len(maplist)
     map_object_list = []
     statement = ""
+    # Store the ids of datasets that must be updated
+    datatsets_to_modify = {}
 
     core.message(_("Gathering map informations"))
 
@@ -218,6 +220,12 @@
             if not core.overwrite:
                 continue
             map.select(dbif)
+            
+            # Safe the datasets that must be updated
+            datasets = map.get_registered_datasets(dbif)
+            for dataset in datasets:
+                datatsets_to_modify[dataset["id"]] = dataset["id"]
+            
             if name and map.get_temporal_type() != sp.get_temporal_type():
                 dbif.close()
                 if map.get_layer():
@@ -283,6 +291,18 @@
     if name:
         core.message(_("Update space time raster dataset"))
         sp.update_from_registered_maps(dbif)
+        
+    # Update affected datasets
+    if datatsets_to_modify:
+        for dataset in datatsets_to_modify:
+            if type == "rast" or type == "raster":
+                ds = dataset_factory("strds", dataset)
+            elif type == "rast3d":
+                ds = dataset_factory("str3ds", dataset)
+            elif type == "vect" or type == "vector":
+                ds = dataset_factory("stvds", dataset)
+            ds.select(dbif)
+            ds.update_from_registered_maps(dbif)
 
     if connect == True:
         dbif.close()

Modified: grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
===================================================================
--- grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2012-09-04 12:00:51 UTC (rev 53082)
+++ grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2012-09-04 13:48:24 UTC (rev 53083)
@@ -5,7 +5,7 @@
 # MODULE:       t.vect.oberve.rast
 # AUTHOR(S):    Soeren Gebbert
 #
-# PURPOSE:      Observe specific locations in a space time raster dataset over a periode of time using vector points
+# PURPOSE:      Observe specific locations in a space time raster dataset over a period of time using vector points
 # COPYRIGHT:    (C) 2011 by the GRASS Development Team
 #
 #               This program is free software under the GNU General Public
@@ -15,7 +15,7 @@
 #############################################################################
 
 #%module
-#% description: Observes specific locations in a space time raster dataset over a periode of time using vector points.
+#% description: Observes specific locations in a space time raster dataset over a period of time using vector points.
 #% keywords: temporal
 #% keywords: sampling
 #%end

Modified: grass/trunk/temporal/t.vect.univar/t.vect.univar.py
===================================================================
--- grass/trunk/temporal/t.vect.univar/t.vect.univar.py	2012-09-04 12:00:51 UTC (rev 53082)
+++ grass/trunk/temporal/t.vect.univar/t.vect.univar.py	2012-09-04 13:48:24 UTC (rev 53083)
@@ -5,7 +5,7 @@
 # MODULE:	t.vect.univar
 # AUTHOR(S):	Soeren Gebbert
 #
-# PURPOSE:	Calculates univariate statistics from the non-null cells for each registered vector map of a space time vector dataset
+# PURPOSE:	Calculates univariate statistics of attributes for each registered vector map of a space time vector dataset
 # COPYRIGHT:	(C) 2011 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
@@ -15,7 +15,7 @@
 #############################################################################
 
 #%module
-#% description: Calculates univariate statistics from the non-null cells for each registered vector map of a space time vector dataset.
+#% description: Calculates univariate statistics of attributes for each registered vector map of a space time vector dataset
 #% keywords: temporal
 #% keywords: statistics
 #% keywords: vector

Modified: grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py
===================================================================
--- grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py	2012-09-04 12:00:51 UTC (rev 53082)
+++ grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py	2012-09-04 13:48:24 UTC (rev 53083)
@@ -5,7 +5,7 @@
 # MODULE:       t.vect.what.strds
 # AUTHOR(S):    Soeren Gebbert
 #
-# PURPOSE:      Uploads raster map values at spatial and temporal positions of vector points to the tables.
+# PURPOSE:      Store raster map values at spatial and temporal positions of vector points as vector attributes.
 # COPYRIGHT:    (C) 2011 by the GRASS Development Team
 #
 #               This program is free software under the GNU General Public
@@ -15,7 +15,7 @@
 #############################################################################
 
 #%module
-#% description: Uploads raster map values at spatial and temporal positions of vector points to the tables.
+#% description: Store raster map values at spatial and temporal positions of vector points as vector attributes.
 #% keywords: temporal
 #% keywords: sampling
 #%end



More information about the grass-commit mailing list