Skip to content

Commit

Permalink
raise error is both corners are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
rwood-97 committed Oct 12, 2023
1 parent 71c0300 commit e852818
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mapreader/download/tile_merging.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ def _load_tile_size(self, grid_bb: GridBoundingBox):
tuple
Size of tile
"""
for corner in [grid_bb.lower_corner, grid_bb.upper_corner]:
try:
start_image = self._load_image_to_grid_cell(grid_bb.lower_corner)
except FileNotFoundError:
logger.warning("Image has missing tiles in bottom left corner.")
try:
start_image = self._load_image_to_grid_cell(corner)
break
except FileNotFoundError:
logger.warning("Image has missing tiles.")
continue
start_image = self._load_image_to_grid_cell(grid_bb.upper_corner)
except FileNotFoundError as err:
logger.warning("Image has missing tiles in upper right corner.")
raise FileNotFoundError("[ERROR] Image is missing tiles for both lower left and upper right corners.")

img_size = start_image.size
assert (
Expand Down

0 comments on commit e852818

Please sign in to comment.