diff --git a/scenes/dates.py b/scenes/dates.py index 4622b82858b6f223859c62de20102afd065c7405..7cbe206ba923e266237547d4c0eb29e1382c629f 100644 --- a/scenes/dates.py +++ b/scenes/dates.py @@ -5,6 +5,10 @@ This module aims to deal with dates import datetime +MINDATE = datetime.datetime.strptime("1000-01-01", "%Y-%m-%d") +MAXDATE = datetime.datetime.strptime("3000-01-01", "%Y-%m-%d") + + def get_timestamp(dt): """Converts datetime.datetime into a timestamp (in seconds) diff --git a/scenes/indexation.py b/scenes/indexation.py index 7ddc8d639cb34e8a36616813f702cc2027ceb9ad..cd0ee5f19e3085df910f71f4df79279be90587c9 100644 --- a/scenes/indexation.py +++ b/scenes/indexation.py @@ -3,7 +3,7 @@ This module contains stuff for the spatio-temporal indexation of scenes """ import datetime import rtree -from scenes.dates import get_timestamp, any2datetime +from scenes.dates import get_timestamp, any2datetime, MINDATE, MAXDATE from scenes.vector import reproject_ogr_layer, get_bbox_wgs84, ogr_open from scenes.spatial import poly_overlap @@ -64,9 +64,9 @@ class Index: """ if not date_min: - date_min = datetime.datetime.strptime("2000-01-01", "%Y-%m-%d") + date_min = MINDATE if not date_max: - date_max = datetime.datetime.strptime("3000-01-01", "%Y-%m-%d") + date_max = MAXDATE # Use the bounding box from the vector data, or from the specified one actual_bbox_wgs84 = vector_or_bbox