From 4eb36a9cd2eaa5d621477293724af53deb78f487 Mon Sep 17 00:00:00 2001 From: Whyjay Zheng Date: Tue, 2 Mar 2021 21:37:23 -0500 Subject: [PATCH 1/2] Add URL support to DataAccessor (.vrt in a local folder if filename is a URL) --- components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py b/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py index b0c3be87..735977e3 100755 --- a/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py +++ b/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py @@ -142,7 +142,12 @@ def createAccessor(self): caster = '' or self.caster filename = self.filename scheme = self.scheme - self.extraFilename = self.filename + '.' + self._extra_reader + #if the filename is a URL, the extraFilename should indicate the file from the local machine + #instead of from the remote server. + if self.filename.startswith('http'): + self.extraFilename = os.path.basename(self.filename) + '.' + self._extra_reader + else: + self.extraFilename = self.filename + '.' + self._extra_reader if self._accessor is None:#to avoid creating duplicates selection = self.methodSelector() From 53c492ee4e60e364d57f790b977beeca35deba94 Mon Sep 17 00:00:00 2001 From: Whyjay Zheng Date: Thu, 4 Mar 2021 14:59:14 -0500 Subject: [PATCH 2/2] Update components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py Explicitly identify URL file names Co-authored-by: Ryan Burns --- components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py b/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py index 735977e3..8a3b859c 100755 --- a/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py +++ b/components/iscesys/ImageApi/DataAccessor/DataAccessorPy.py @@ -144,7 +144,7 @@ def createAccessor(self): scheme = self.scheme #if the filename is a URL, the extraFilename should indicate the file from the local machine #instead of from the remote server. - if self.filename.startswith('http'): + if self.filename.startswith('http://') or self.filename.startswith('https://'): self.extraFilename = os.path.basename(self.filename) + '.' + self._extra_reader else: self.extraFilename = self.filename + '.' + self._extra_reader