time_interval fix
@@ -108,6 +108,8 @@ class SentinelHubOGCInput(EOTask):
"""
service_type = ServiceType(self._get_parameter('service_type', eopatch))
+ if time_interval is None:
+ time_interval = self._get_parameter('time_interval', eopatch)
if service_type is ServiceType.WMS:
size_x_name, size_y_name = 'width', 'height'
else:
@@ -115,9 +117,8 @@ class SentinelHubOGCInput(EOTask):
return {
'layer': self.layer,
'bbox': bbox if bbox is not None else self._get_parameter('bbox', eopatch),
- 'time': time_interval if time_interval is not None else[
- datetime_to_iso(x) if not isinstance(x, str) else x
- for x in self._get_parameter('time_interval', eopatch)],
+ 'time': datetime_to_iso(time_interval) if isinstance(time_interval, str) else [
+ datetime_to_iso(x) if not isinstance(x, str) else x for x in time_interval],
'time_difference': self._get_parameter('time_difference', eopatch),
'maxcc': self._get_parameter('maxcc', eopatch),
'image_format': self.image_format,
@@ -158,9 +159,8 @@ class SentinelHubOGCInput(EOTask):
if eoparam not in eopatch.meta_info:
if param == 'time':
value = request_params[param]
- eopatch.meta_info[eoparam] = value if isinstance(value, str) else [iso_to_datetime(parse_time(x))
- if isinstance(x, str)
- else x for x in value]
+ eopatch.meta_info[eoparam] = value if isinstance(value, str) else [
+ iso_to_datetime(parse_time(x)) if isinstance(x, str) else x for x in value]
else:
eopatch.meta_info[eoparam] = request_params[param]
