Skip to content

Commit

Permalink
download filename name fix for S1 and DEM
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksMat committed May 3, 2018
1 parent 2b575a6 commit b0ad31b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions SentinelHub/SentinelHub.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,17 @@ def get_filename(self, bbox):
:param bbox:
:return:
"""
info_list = [self.get_source_name(), Settings.parameters['layers']] \
+ Settings.parameters['time'].split('/')[:2] + bbox.split(',') \
+ [Settings.parameters['maxcc'], Settings.parameters['priority']]
info_list = [self.get_source_name(), Settings.parameters['layers']]
if not self.is_timeless_source():
info_list.append(self.get_time_name())
info_list.extend(bbox.split(','))
if not self.is_cloudless_source():
info_list.append(Settings.parameters['maxcc'])
info_list.append(Settings.parameters['priority'])

name = '.'.join(map(str, ['_'.join(map(str, info_list)),
Settings.parameters_wcs['format'].split(';')[0].split('/')[1]]))
return name.replace(' ', '').replace(':', '_')
return name.replace(' ', '').replace(':', '_').replace('/', '_')

def get_source_name(self):
""" Returns name of the data source
Expand Down

0 comments on commit b0ad31b

Please sign in to comment.