[GRASS-SVN] r59066 - grass/trunk/temporal/t.rast.aggregate
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 16 04:10:45 PST 2014
Author: huhabla
Date: 2014-02-16 04:10:45 -0800 (Sun, 16 Feb 2014)
New Revision: 59066
Modified:
grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
Log:
Fixed new introduced bug in t.rast.aggregate
Modified: grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py 2014-02-16 11:02:42 UTC (rev 59065)
+++ grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py 2014-02-16 12:10:45 UTC (rev 59066)
@@ -109,12 +109,27 @@
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)
More information about the grass-commit
mailing list