Commit ea4813b4 authored by Cresson Remi's avatar Cresson Remi
Browse files

REFAC: big refactoring

1 merge request!27Index search vector
Pipeline #34955 passed with stages
in 2 minutes and 22 seconds
Showing with 7 additions and 3 deletions
+7 -3
...@@ -5,6 +5,10 @@ This module aims to deal with dates ...@@ -5,6 +5,10 @@ This module aims to deal with dates
import datetime 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): def get_timestamp(dt):
"""Converts datetime.datetime into a timestamp (in seconds) """Converts datetime.datetime into a timestamp (in seconds)
......
...@@ -3,7 +3,7 @@ This module contains stuff for the spatio-temporal indexation of scenes ...@@ -3,7 +3,7 @@ This module contains stuff for the spatio-temporal indexation of scenes
""" """
import datetime import datetime
import rtree 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.vector import reproject_ogr_layer, get_bbox_wgs84, ogr_open
from scenes.spatial import poly_overlap from scenes.spatial import poly_overlap
...@@ -64,9 +64,9 @@ class Index: ...@@ -64,9 +64,9 @@ class Index:
""" """
if not date_min: if not date_min:
date_min = datetime.datetime.strptime("2000-01-01", "%Y-%m-%d") date_min = MINDATE
if not date_max: 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 # Use the bounding box from the vector data, or from the specified one
actual_bbox_wgs84 = vector_or_bbox actual_bbox_wgs84 = vector_or_bbox
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment