[GRASS-SVN] r48847 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 18 10:19:55 EDT 2011


Author: huhabla
Date: 2011-10-18 07:19:55 -0700 (Tue, 18 Oct 2011)
New Revision: 48847

Modified:
   grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
Log:
Compute temporal gaps for point and mixed time


Modified: grass/trunk/lib/python/temporal/abstract_space_time_dataset.py
===================================================================
--- grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2011-10-18 13:10:27 UTC (rev 48846)
+++ grass/trunk/lib/python/temporal/abstract_space_time_dataset.py	2011-10-18 14:19:55 UTC (rev 48847)
@@ -233,25 +233,21 @@
 
         return tcount
 
-    def count_gaps(self, maps, is_interval = False):
-        """Count the number of gaps between temporal neighbours. The maps must have intervals as valid time
+    def count_gaps(self, maps):
+        """Count the number of gaps between temporal neighbours
         
            @param maps: A sorted (start_time) list of abstract_dataset objects
-           @param is_interval: Set true if the maps have vaild interval time (relative or absolute)
            @return The numbers of gaps between temporal neighbours
         """
 
         gaps = 0
 
         # Check for gaps
-        if is_interval:    
-            for i in range(len(maps)):
-                if i < len(maps) - 1:
-                    relation = maps[i + 1].temporal_relation(maps[i])
-                    if relation == "after":
-                        gaps += 1
-        else:
-            gaps = None # Gaps only possible in temporal consistent datasets (only intervals)
+        for i in range(len(maps)):
+            if i < len(maps) - 1:
+                relation = maps[i + 1].temporal_relation(maps[i])
+                if relation == "after":
+                    gaps += 1
 
         return gaps
 



More information about the grass-commit mailing list