From 67736ec076052559d527b5d812aac576b301ee39 Mon Sep 17 00:00:00 2001 From: falkamelung Date: Mon, 7 Aug 2023 22:17:35 -0500 Subject: [PATCH] DemStitcher.py: fix name of wrongly named unzipped SRTM tiles --- contrib/demUtils/demstitcher/DemStitcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/demUtils/demstitcher/DemStitcher.py b/contrib/demUtils/demstitcher/DemStitcher.py index 0cbc6f120..a455d869c 100755 --- a/contrib/demUtils/demstitcher/DemStitcher.py +++ b/contrib/demUtils/demstitcher/DemStitcher.py @@ -555,6 +555,10 @@ def decompress(self,filename,downloadDir = None,keep = None): zip = zipfile.ZipFile(filen,'r') import zlib zip.extractall(downloadDir) + if not os.path.exists(os.path.basename(filen)[0:7] + '.hgt') : + if os.path.exists(os.path.basename(filen)[0:7] + '.SRTMGL1.hgt') : + os.rename(os.path.basename(filen)[0:7] + '.SRTMGL1.hgt', os.path.basename(filen)[0:7] + '.hgt') + except: self.extract(downloadDir,filen) @@ -564,7 +568,6 @@ def decompress(self,filename,downloadDir = None,keep = None): def extract(self,downloadDir,filen): os.system('unzip -o -qq ' + os.path.join(filen) + ' -d ' + downloadDir) - def defaultName(self,snwe): latMin = math.floor(snwe[0]) latMax = math.ceil(snwe[1])