Skip to content

Commit

Permalink
compressed save raster
Browse files Browse the repository at this point in the history
  • Loading branch information
yotarazona authored Jun 15, 2024
1 parent f8875fb commit b79e1c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scikeo/writeRaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def writeRaster(arr, image, filename = None, filepath = None, n = 1):
})

if arr.ndim == 2:
with rasterio.open(path_name, 'w', **kwargs) as img:
with rasterio.open(path_name, 'w', compress='lzw', **kwargs) as img:
img.write_band(1, arr)
else:
with rasterio.open(path_name, 'w', **kwargs) as img:
with rasterio.open(path_name, 'w', compress='lzw', **kwargs) as img:
for num, name in enumerate([arr[:,:,i] for i in range(n)], start=1):
img.write_band(num, name)

0 comments on commit b79e1c9

Please sign in to comment.