Skip to content

Commit e432e5d

Browse files
committed
Minor improvements to vizgen error handling
1 parent 3bf7465 commit e432e5d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

bin/vizgen.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def zarr2tiff(input_file, config, process_existing=False, limit=-1, create_cog=F
118118
print('Created GeoTIFF ' + output_file)
119119

120120
# TODO: Check if we need to flip y-axis
121-
print('Converting coordinates from 0 - 360 to -180 - 180')
121+
print('Flipping y-axis')
122122
output_file_360 = output_file.replace('.tiff', '_360.tiff')
123123
print('Creating GeoTIFF file ' + output_file_360)
124124
gdal_warp = ['gdalwarp', '-t_srs', 'WGS84', '-te', '-180', '-90', '180', '90', output_file,
@@ -131,7 +131,11 @@ def zarr2tiff(input_file, config, process_existing=False, limit=-1, create_cog=F
131131
for error in process.stderr:
132132
print(error.decode())
133133
print('Created GeoTIFF ' + output_file_360)
134-
shutil.move(output_file_360, output_file)
134+
try:
135+
shutil.move(output_file_360, output_file)
136+
except FileNotFoundError as ex:
137+
print(ex)
138+
continue
135139
print('Replaced ' + output_file)
136140

137141
if create_cog:
@@ -478,8 +482,11 @@ def create_mrf(input_files, config, layer_name, colormap, empty_tile):
478482

479483
except FileNotFoundError as ex:
480484
print(ex)
481-
print('Deleting file ' + mrf_config)
482-
os.remove(mrf_config)
485+
try:
486+
print('Deleting file ' + mrf_config)
487+
os.remove(mrf_config)
488+
except FileNotFoundError as ex:
489+
print(ex)
483490

484491

485492
if __name__ == '__main__':

version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

33
# The VIZGEN version to use in the Docker image tag (e.g. coverage/vizgen:{VIZGEN_VERSION}).
4-
export VIZGEN_VERSION=0.6.1
4+
export VIZGEN_VERSION=0.6.2

0 commit comments

Comments
 (0)