[GRASS-SVN] r55720 - grass/trunk/gui/wxpython/animation

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 12 11:51:28 PDT 2013


Author: huhabla
Date: 2013-04-12 11:51:27 -0700 (Fri, 12 Apr 2013)
New Revision: 55720

Modified:
   grass/trunk/gui/wxpython/animation/temporal_manager.py
Log:
More usage of the tgis space time dataset API


Modified: grass/trunk/gui/wxpython/animation/temporal_manager.py
===================================================================
--- grass/trunk/gui/wxpython/animation/temporal_manager.py	2013-04-12 14:16:23 UTC (rev 55719)
+++ grass/trunk/gui/wxpython/animation/temporal_manager.py	2013-04-12 18:51:27 UTC (rev 55720)
@@ -307,30 +307,20 @@
         """!Get info about timeseries and check topology (raises GException)"""
         id = validateTimeseriesName(timeseries, etype)
         sp = tgis.dataset_factory(etype, id)
-        # sp = tgis.SpaceTimeRasterDataset(ident = id)
-
         # Insert content from db
         sp.select()
         # Get ordered map list
         maps = sp.get_registered_maps_as_objects()
-        # check topology
-        check = sp.check_temporal_topology(maps)
-        if not check:
+	if not sp.check_temporal_topology(maps):
             raise GException(_("Topology of Space time dataset %s is invalid." % id))
 
         timeseriesList.append(id)
         infoDict[id] = {}
         infoDict[id]['etype'] = etype
-        # compute granularity
         infoDict[id]['temporal_type'] = sp.get_temporal_type()
-        if infoDict[id]['temporal_type'] == 'absolute':
-            gran = tgis.compute_absolute_time_granularity(maps)
-        else:
-            start, end, infoDict[id]['unit'] = sp.get_relative_time()
-            gran = tgis.compute_relative_time_granularity(maps)
-
-        infoDict[id]['granularity'] = gran
-
+	if sp.is_time_relative():
+            infoDict[id]['unit'] = sp.get_relative_time_unit()
+        infoDict[id]['granularity'] = sp.get_granularity()
         infoDict[id]['map_time'] = sp.get_map_time()
         infoDict[id]['maps'] = maps
 



More information about the grass-commit mailing list