Skip to content

Commit

Permalink
Fix transform bug for array to image (opengeos#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Jun 6, 2024
1 parent 442dcc1 commit c70b9c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10352,7 +10352,7 @@ def array_to_memory_file(
if hasattr(array, "rio"):
if hasattr(array.rio, "crs"):
crs = array.rio.crs
if hasattr(array.rio, "transform"):
if transform is None and hasattr(array.rio, "transform"):
transform = array.rio.transform()
elif source is None:
if hasattr(array, "encoding"):
Expand All @@ -10362,7 +10362,6 @@ def array_to_memory_file(

if array.ndim == 3 and transpose:
array = np.transpose(array, (1, 2, 0))

if source is not None:
with rasterio.open(source) as src:
crs = src.crs
Expand Down

0 comments on commit c70b9c0

Please sign in to comment.