Skip to content

Commit

Permalink
Adjusting time_interval_interpretation for time intervals with equal …
Browse files Browse the repository at this point in the history
…start and stop time.
  • Loading branch information
Schpidi committed Jun 1, 2015
1 parent 6ad73a4 commit 24b75e8
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions eoxserver/resources/coverages/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,16 @@ def applyToQuerySet(self, expr, qs):
eo_metadata__timestamp_end__gt=begin
)
else:
return qs.exclude(
eo_metadata__timestamp_begin__gte=end
).exclude(
eo_metadata__timestamp_end__lte=begin
)
if begin == end:
return qs.filter(
eo_metadata__timestamp_begin__lte=end,
eo_metadata__timestamp_end__gte=begin
)
else:
return qs.filter(
eo_metadata__timestamp_begin__lt=end,
eo_metadata__timestamp_end__gt=begin
)
else:
if begin == "unbounded":
if end == "unbounded":
Expand All @@ -800,10 +805,9 @@ def applyToQuerySet(self, expr, qs):
eo_metadata__timestamp_end__gte=begin
)
else:
return qs.exclude(
eo_metadata__timestamp_begin__gt=end
).exclude(
eo_metadata__timestamp_end__lt=begin
return qs.filter(
eo_metadata__timestamp_begin__lte=end,
eo_metadata__timestamp_end__gte=begin
)

def resourceMatches(self, expr, res):
Expand Down Expand Up @@ -896,10 +900,16 @@ def applyToQuerySet(self, expr, qs):
eo_metadata__timestamp_begin__gt=begin
)
else:
return qs.filter(
eo_metadata__timestamp_begin__gt=begin,
eo_metadata__timestamp_end__lt=end
)
if begin == end:
return qs.filter(
eo_metadata__timestamp_begin__gte=begin,
eo_metadata__timestamp_end__lte=end
)
else:
return qs.filter(
eo_metadata__timestamp_begin__gt=begin,
eo_metadata__timestamp_end__lt=end
)
else:
if begin == "unbounded":
if end == "unbounded":
Expand Down

0 comments on commit 24b75e8

Please sign in to comment.