Skip to content

Commit f31d9b3

Browse files
authored
Merge pull request #8 from scottstanie/gdal-fixes
Gdal fixes
2 parents f75df52 + ec9dfd5 commit f31d9b3

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

sardem/cop_dem.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ def download_and_stitch(
6363
# Used the __RETURN_OPTION_LIST__ to get the list of options for debugging
6464
logger.info("Creating {}".format(output_name))
6565
logger.info("Fetching remote tiles...")
66-
cmd = _gdal_cmd_from_options(vrt_filename, output_name, option_dict)
67-
logger.info("Running GDAL command:")
66+
try:
67+
cmd = _gdal_cmd_from_options(vrt_filename, output_name, option_dict)
68+
logger.info("Running GDAL command:")
69+
logger.info(cmd)
70+
except Exception:
71+
# Can't form the cli version due to `deepcopy` Pickle error, just skip
72+
logger.info("Running gdal Warp with options:")
73+
logger.info(option_dict)
74+
pass
75+
# Now convert to something GDAL can actually use
6876
option_dict["callback"] = gdal.TermProgress
69-
logger.info(cmd)
70-
# Now convert to something GDAL can actuall use
7177
gdal.Warp(output_name, vrt_filename, options=gdal.WarpOptions(**option_dict))
7278
return
7379

sardem/dem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,9 @@ def main(
452452

453453
if make_isce_xml:
454454
logger.info("Creating ISCE2 XML file")
455-
utils.gdal2isce_xml(output_name, keep_egm=keep_egm, shift_rsc=using_gdal_bounds)
455+
utils.gdal2isce_xml(
456+
output_name, keep_egm=keep_egm, using_gdal_bounds=using_gdal_bounds
457+
)
456458

457459
if keep_egm or data_source == "NASA_WATER":
458460
logger.info("Keeping DEM as EGM96 geoid heights")

sardem/tests/test_dem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TestDownload(unittest.TestCase):
3737
def setUp(self):
3838
self.bounds = utils.bounding_box(-155.4, 19.75, 0.001, 0.001)
3939
self.test_tile = "N19W156"
40-
self.hgt_url = "http://e4ftl01.cr.usgs.gov/MEASURES/\
40+
self.hgt_url = "https://e4ftl01.cr.usgs.gov/MEASURES/\
4141
SRTMGL1.003/2000.02.11/N19W156.SRTMGL1.hgt.zip"
4242

4343
sample_hgt_path = join(DATAPATH, self.test_tile + ".hgt.zip")
@@ -52,7 +52,7 @@ def tearDown(self):
5252
def test_init(self):
5353
d = download.Downloader([self.test_tile], netrc_file=NETRC_PATH)
5454
self.assertEqual(
55-
d.data_url, "http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11"
55+
d.data_url, "https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11"
5656
)
5757

5858
@responses.activate

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="sardem",
8-
version="0.10.5",
8+
version="0.10.6",
99
author="Scott Staniewicz",
1010
author_email="scott.stanie@gmail.com",
1111
description="Create upsampled DEMs for InSAR processing",

0 commit comments

Comments
 (0)