[GRASS-SVN] r48330 - in grass/trunk: . lib/python lib/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 17 08:08:03 EDT 2011


Author: huhabla
Date: 2011-09-17 05:08:03 -0700 (Sat, 17 Sep 2011)
New Revision: 48330

Added:
   grass/trunk/svn-commit.3.tmp
   grass/trunk/svn-commit.tmp
Modified:
   grass/trunk/lib/python/tgis_abstract_datasets.py
   grass/trunk/lib/python/tgis_base.py
   grass/trunk/lib/python/tgis_metadata.py
   grass/trunk/lib/python/tgis_spatial_extent.py
   grass/trunk/lib/python/tgis_temporal_extent.py
   grass/trunk/lib/temporal/test.temporal.py
Log:
Better metadata info.

Modified: grass/trunk/lib/python/tgis_abstract_datasets.py
===================================================================
--- grass/trunk/lib/python/tgis_abstract_datasets.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/python/tgis_abstract_datasets.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -119,6 +119,38 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        
+        if self.get_type() == "raster":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Raster Dataset ----------------------------------------+"
+        if self.get_type() == "raster3d":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Raster3d Dataset --------------------------------------+"
+        if self.get_type() == "vector":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Vector Dataset ----------------------------------------+"
+        if self.get_type() == "strds":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Space Time Raster Dataset -----------------------------+"
+        if self.get_type() == "str3ds":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Space Time Raster3d Dataset ---------------------------+"
+        if self.get_type() == "stvds":
+            #                1         2         3         4         5         6         7
+            #      0123456789012345678901234567890123456789012345678901234567890123456789012345678
+            print ""
+            print " +-------------------- Space Time Vector Dataset -----------------------------+"
+        print " |                                                                            |"
 	self.base.print_info()
 	if self.is_time_absolute():
 	    self.absolute_time.print_info()
@@ -126,6 +158,7 @@
 	    self.relative_time.print_info()
 	self.spatial_extent.print_info()
 	self.metadata.print_info()
+        print " +----------------------------------------------------------------------------+"
 
     def print_shell_info(self):
         """Print information about this class in shell style"""

Modified: grass/trunk/lib/python/tgis_base.py
===================================================================
--- grass/trunk/lib/python/tgis_base.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/python/tgis_base.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -365,15 +365,16 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  Id: ........................ " + str(self.get_id())
-        print "  Name: ...................... " + str(self.get_name())
-        print "  Mapset: .................... " + str(self.get_mapset())
-        print "  Creator: ................... " + str(self.get_creator())
-        print "  Creation time: ............. " + str(self.get_ctime())
-        print "  Modification time: ......... " + str(self.get_mtime())
-        print "  Temporal type: ............. " + str(self.get_ttype())
-        print "  Revision in database: ...... " + str(self.get_revision())
-
+        print " +-------------------- Basic information -------------------------------------+"
+        print " | Id: ........................ " + str(self.get_id())
+        print " | Name: ...................... " + str(self.get_name())
+        print " | Mapset: .................... " + str(self.get_mapset())
+        print " | Creator: ................... " + str(self.get_creator())
+        print " | Creation time: ............. " + str(self.get_ctime())
+        print " | Modification time: ......... " + str(self.get_mtime())
+        print " | Temporal type: ............. " + str(self.get_ttype())
+        print " | Revision in database: ...... " + str(self.get_revision())
+        
     def print_shell_info(self):
         """Print information about this class in shell style"""
         print "id=" + str(self.get_id())

Modified: grass/trunk/lib/python/tgis_metadata.py
===================================================================
--- grass/trunk/lib/python/tgis_metadata.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/python/tgis_metadata.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -153,14 +153,14 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  Datatype:................... " + str(self.get_datatype())
-        print "  Number of columns:.......... " + str(self.get_cols())
-        print "  Number of rows:............. " + str(self.get_rows())
-        print "  Number of cells:............ " + str(self.get_number_of_cells())
-        print "  North-South resolution:..... " + str(self.get_nsres())
-        print "  East-west resolution:....... " + str(self.get_ewres())
-        print "  Minimum value:.............. " + str(self.get_min())
-        print "  Maximum value:.............. " + str(self.get_max())
+        print " | Datatype:................... " + str(self.get_datatype())
+        print " | Number of columns:.......... " + str(self.get_cols())
+        print " | Number of rows:............. " + str(self.get_rows())
+        print " | Number of cells:............ " + str(self.get_number_of_cells())
+        print " | North-South resolution:..... " + str(self.get_nsres())
+        print " | East-west resolution:....... " + str(self.get_ewres())
+        print " | Minimum value:.............. " + str(self.get_min())
+        print " | Maximum value:.............. " + str(self.get_max())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -197,6 +197,9 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        print " +-------------------- Metadata information ----------------------------------+"
+        #      0123456789012345678901234567890
+        print " | STRDS register table ....... " + str(self.get_strds_register())
         raster_metadata_base.print_info(self)
 
     def print_shell_info(self):
@@ -253,11 +256,19 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        print " +-------------------- Metadata information ----------------------------------+"
+        #      0123456789012345678901234567890
+        print " | STR3DS register table ...... " + str(self.get_str3ds_register())
         raster_metadata_base.print_info(self)
+        #      0123456789012345678901234567890
+        print " | Number of depths:........... " + str(self.get_depths())
+        print " | Top-Bottom resolution:...... " + str(self.get_tbres())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
         raster_metadata_base.print_shell_info(self)
+        print "depths=" + str(self.get_depths())
+        print "tbres=" + str(self.get_tbres())
         
 ###############################################################################
 
@@ -300,7 +311,8 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  STVDS register table ....... " + str(self.get_stvds_register())
+        print " +-------------------- Metadata information ----------------------------------+"
+        print " | STVDS register table ....... " + str(self.get_stvds_register())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -372,11 +384,11 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  Number of registered maps:.. " + str(self.get_number_of_maps())
-        print "  Title:"
-        print "  " + str(self.get_title())
-        print "  Description:"
-        print "  " + str(self.get_description())
+        print " | Number of registered maps:.. " + str(self.get_number_of_maps())
+        print " | Title:"
+        print " | " + str(self.get_title())
+        print " | Description:"
+        print " | " + str(self.get_description())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -441,15 +453,6 @@
         else:
 	    return None
 
-    def get_min_max(self):
-	"""Get the minimal maximum of all registered maps, this value is set in the database
-           automatically via SQL trigger, so no setter exists
-	   @return None if not found"""
-	if self.D.has_key("min_max"):
-	    return self.D["min_max"]
-        else:
-	    return None
-
     def get_nsres_min(self):
 	"""Get the minimal north-south resolution of all registered maps, this value is set in the database
            automatically via SQL trigger, so no setter exists
@@ -489,10 +492,27 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         stds_metadata_base.print_info(self)
+        #      0123456789012345678901234567890
+        print " | North-South resolution min:. " + str(self.get_nsres_min())
+        print " | North-South resolution max:. " + str(self.get_nsres_max())
+        print " | East-west resolution min:... " + str(self.get_ewres_min())
+        print " | East-west resolution max:... " + str(self.get_ewres_max())
+        print " | Minimum value min:.......... " + str(self.get_min_min())
+        print " | Minimum value max:.......... " + str(self.get_min_max())
+        print " | Maximum value min:.......... " + str(self.get_max_min())
+        print " | Maximum value max:.......... " + str(self.get_max_max())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
         stds_metadata_base.print_shell_info(self)
+        print "nsres_min=" + str(self.get_nsres_min())
+        print "nsres_max=" + str(self.get_nsres_max())
+        print "ewres_min=" + str(self.get_ewres_min())
+        print "ewres_max=" + str(self.get_ewres_max())
+        print "min_min=" + str(self.get_min_min())
+        print "min_max=" + str(self.get_min_max())
+        print "max_min=" + str(self.get_max_min())
+        print "max_max=" + str(self.get_max_max())
 
 
 ###############################################################################
@@ -519,6 +539,9 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        print " +-------------------- Metadata information ----------------------------------+"
+        #      0123456789012345678901234567890
+        print " | Raster register table:...... " + str(self.get_raster_register())
         stds_raster_metadata_base.print_info(self)
 
     def print_shell_info(self):
@@ -569,11 +592,19 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        print " +-------------------- Metadata information ----------------------------------+"
+        #      0123456789012345678901234567890
+        print " | Raster3d register table:.... " + str(self.get_raster3d_register())
         stds_raster_metadata_base.print_info(self)
+        #      0123456789012345678901234567890
+        print " | Top-bottom resolution min:.. " + str(self.get_ewres_min())
+        print " | Top-bottom resolution max:.. " + str(self.get_ewres_max())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
         stds_raster_metadata_base.print_shell_info(self)
+        print "tbres_min=" + str(self.get_tbres_min())
+        print "tbres_max=" + str(self.get_tbres_max())
 
 ###############################################################################
 
@@ -599,6 +630,9 @@
 
     def print_info(self):
         """Print information about this class in human readable style"""
+        print " +-------------------- Metadata information ----------------------------------+"
+        #      0123456789012345678901234567890
+        print " | Vector register table:...... " + str(self.get_vector_register())
         stds_metadata_base.print_info(self)
 
     def print_shell_info(self):

Modified: grass/trunk/lib/python/tgis_spatial_extent.py
===================================================================
--- grass/trunk/lib/python/tgis_spatial_extent.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/python/tgis_spatial_extent.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -245,12 +245,13 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  North:...................... " + str(self.get_north())
-        print "  South:...................... " + str(self.get_south())
-        print "  East:.. .................... " + str(self.get_east())
-        print "  West:....................... " + str(self.get_west())
-        print "  Top:........................ " + str(self.get_top())
-        print "  Bottom:..................... " + str(self.get_bottom())
+        print " +-------------------- Spatial extent ----------------------------------------+"
+        print " | North:...................... " + str(self.get_north())
+        print " | South:...................... " + str(self.get_south())
+        print " | East:.. .................... " + str(self.get_east())
+        print " | West:....................... " + str(self.get_west())
+        print " | Top:........................ " + str(self.get_top())
+        print " | Bottom:..................... " + str(self.get_bottom())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""

Modified: grass/trunk/lib/python/tgis_temporal_extent.py
===================================================================
--- grass/trunk/lib/python/tgis_temporal_extent.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/python/tgis_temporal_extent.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -266,9 +266,10 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  Start time:................. " + str(self.get_start_time())
-        print "  End time:................... " + str(self.get_end_time())
-        print "  Timezone:................... " + str(self.get_timezone())
+        print " +-------------------- Absolute time -----------------------------------------+"
+        print " | Start time:................. " + str(self.get_start_time())
+        print " | End time:................... " + str(self.get_end_time())
+        print " | Timezone:................... " + str(self.get_timezone())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -314,7 +315,7 @@
         """Print information about this class in human readable style"""
         absolute_temporal_extent.print_info(self)
         #      0123456789012345678901234567890
-        print "  Granularity:................ " + str(self.get_granularity())
+        print " | Granularity:................ " + str(self.get_granularity())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -417,7 +418,8 @@
     def print_info(self):
         """Print information about this class in human readable style"""
         #      0123456789012345678901234567890
-        print "  Interval:................... " + str(self.get_interval())
+        print " +-------------------- Relative time -----------------------------------------+"
+        print " |  Interval:................... " + str(self.get_interval())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""
@@ -462,7 +464,7 @@
         """Print information about this class in human readable style"""
         relative_temporal_extent.print_info(self)
         #      0123456789012345678901234567890
-        print "  Granularity:................ " + str(self.get_granularity())
+        print " | Granularity:................ " + str(self.get_granularity())
 
     def print_shell_info(self):
         """Print information about this class in shell style"""

Modified: grass/trunk/lib/temporal/test.temporal.py
===================================================================
--- grass/trunk/lib/temporal/test.temporal.py	2011-09-17 09:32:13 UTC (rev 48329)
+++ grass/trunk/lib/temporal/test.temporal.py	2011-09-17 12:08:03 UTC (rev 48330)
@@ -672,7 +672,8 @@
         strds.register_map(rds)
         # Print self info
         #rds.print_self()
-    
+
+    strds.update_from_registered_maps()
     strds.select()
     # Print self info
     strds.print_self()
@@ -738,7 +739,8 @@
         str3ds.register_map(r3ds)
         # Print self info
         #r3ds.print_self()
-    
+
+    str3ds.update_from_registered_maps()
     str3ds.select()
     # Print self info
     str3ds.print_self()
@@ -806,6 +808,7 @@
         # Print self info
         #vds.print_self()
 
+    stvds.update_from_registered_maps()
     stvds.select()
     # Print self info
     stvds.print_self()

Added: grass/trunk/svn-commit.3.tmp
===================================================================
--- grass/trunk/svn-commit.3.tmp	                        (rev 0)
+++ grass/trunk/svn-commit.3.tmp	2011-09-17 12:08:03 UTC (rev 48330)
@@ -0,0 +1,7 @@
+New module to print informations about temporal datasets.
+-- Diese und die folgenden Zeilen werden ignoriert --
+
+A    temporal/t.info
+A    temporal/t.info/t.info.html
+AM   temporal/t.info/t.info.py
+A    temporal/t.info/Makefile

Added: grass/trunk/svn-commit.tmp
===================================================================
--- grass/trunk/svn-commit.tmp	                        (rev 0)
+++ grass/trunk/svn-commit.tmp	2011-09-17 12:08:03 UTC (rev 48330)
@@ -0,0 +1,21 @@
+New modules for temporal dataset handling and management.
+-- Diese und die folgenden Zeilen werden ignoriert --
+
+M    temporal/t.remove/t.remove.py
+M    temporal/t.create/t.create.py
+A    temporal/tr.register
+AM   temporal/tr.register/tr.register.py
+A    temporal/tr.register/tr.register.html
+A    temporal/tr.register/Makefile
+A    temporal/tr.unregister
+AM   temporal/tr.unregister/tr.unregister.py
+A    temporal/tr.unregister/Makefile
+A    temporal/tr.unregister/tr.unregister.html
+A    temporal/t.info
+A    temporal/t.info/t.info.html
+AM   temporal/t.info/t.info.py
+A    temporal/t.info/Makefile
+A    temporal/t.list
+A    temporal/t.list/t.list.html
+AM   temporal/t.list/t.list.py
+A    temporal/t.list/Makefile



More information about the grass-commit mailing list