Browse Source

Affected space time datasets will be updated in case time stamps are changed for registered maps.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53083 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 12 năm trước cách đây
mục cha
commit
b1f9cba6bb

+ 20 - 0
lib/python/temporal/space_time_datasets_tools.py

@@ -176,6 +176,8 @@ def register_maps_in_space_time_dataset(
     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 @@ def register_maps_in_space_time_dataset(
             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 @@ def register_maps_in_space_time_dataset(
     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()

+ 2 - 2
temporal/t.vect.observe.strds/t.vect.observe.strds.py

@@ -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

+ 2 - 2
temporal/t.vect.univar/t.vect.univar.py

@@ -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

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

@@ -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