Quellcode durchsuchen

Fixed new introduced bug in t.rast.aggregate

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59066 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert vor 11 Jahren
Ursprung
Commit
bc8b61f023
1 geänderte Dateien mit 16 neuen und 1 gelöschten Zeilen
  1. 16 1
      temporal/t.rast.aggregate/t.rast.aggregate.py

+ 16 - 1
temporal/t.rast.aggregate/t.rast.aggregate.py

@@ -109,12 +109,27 @@ def main():
     else:
         first_start_time = rows[0]["start_time"]
 
+    # We use the end time first
     last_start_time = rows[len(rows) - 1]["end_time"]
+    is_end_time = True
+
+    # In case no end time is available, then we use the start time
+    if last_start_time is None:
+        last_start_time = rows[len(rows) - 1]["start_time"]
+        is_end_time = False
+
     next_start_time = first_start_time
 
     count = 0
 
-    while next_start_time < last_start_time:
+    while True:
+        if is_end_time is True:
+            if next_start_time >= last_start_time:
+                break
+        else:
+            if next_start_time > last_start_time:
+                break
+
         start = next_start_time
         if sp.is_time_absolute():
             end = tgis.increment_datetime_by_string(next_start_time, gran)