Skip to content

Commit

Permalink
Merge branch 'dev_download' of https://github.com/Living-with-machine…
Browse files Browse the repository at this point in the history
…s/MapReader into dev_download
  • Loading branch information
rwood-97 committed Oct 19, 2023
2 parents 46e5688 + 6f1f96d commit 32cdc9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mapreader/download/sheet_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def _save_metadata(
if os.path.exists(out_filepath):
existing_metadata_df = pd.read_csv(out_filepath, sep=",", index_col=0)
metadata_df = pd.concat([existing_metadata_df, new_metadata_df], ignore_index=True)
metadata_df.drop_duplicates(subset=["grid_bb"], keep="first", inplace=True)
metadata_df.drop_duplicates(keep="first", inplace=True)
else:
metadata_df = new_metadata_df

Expand Down
6 changes: 5 additions & 1 deletion mapreader/download/tile_merging.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ def merge(self, grid_bb: GridBoundingBox, file_name: Union[str, None] = None) ->
"""
os.makedirs(self.output_folder, exist_ok=True)

tile_size = self._load_tile_size(grid_bb)
try:
tile_size = self._load_tile_size(grid_bb)
except FileNotFoundError:
return False # unsuccessful

merged_image = Image.new(
"RGBA", (len(grid_bb.x_range) * tile_size, len(grid_bb.y_range) * tile_size)
)
Expand Down

0 comments on commit 32cdc9e

Please sign in to comment.