Skip to content
Snippets Groups Projects
Commit 522d7aa5 authored by paul.tresson_ird.fr's avatar paul.tresson_ird.fr
Browse files

add exception handling during merging of temp files. Should be a temporary fix to #45

parent 48db867d
No related branches found
No related tags found
No related merge requests found
...@@ -617,12 +617,19 @@ class EncoderAlgorithm(IAMAPAlgorithm): ...@@ -617,12 +617,19 @@ class EncoderAlgorithm(IAMAPAlgorithm):
dst_path = Path(os.path.join(self.output_subdir, "merged_tmp.tif")) dst_path = Path(os.path.join(self.output_subdir, "merged_tmp.tif"))
merge_tiles( try:
tiles=all_tiles, merge_tiles(
dst_path=dst_path, tiles=all_tiles,
method=self.merge_method, dst_path=dst_path,
) method=self.merge_method,
self.remove_temp_files() )
self.remove_temp_files()
# overwritting merged_tmp.tif may be impossible in windows (e.g. if an antivirus is analysing the newly created data)
# then, merging and cleaning is impossible
except rasterio._err.CPLE_AppDefinedError as e :
feedback.pushWarning(f"Unable to cleaning temporary files ! Try to delete them latter at {self.output_subdir}")
self.all_encoding_done = True self.all_encoding_done = True
# Update the progress bar # Update the progress bar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment