Skip to content

Commit

Permalink
Merge 8a05ec9 into 60c4552
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Jan 26, 2021
2 parents 60c4552 + 8a05ec9 commit e4fcdd8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Latest
- ENH: Add support for merging datasets with different CRS (issue #173)
- ENH: Add support for using dask in `rio.to_raster` (issue #9)
- BUG: Allow `rio.write_crs` when spatial dimensions not found (pull #186)
- BUG: Update to support rasterio 1.2+ merge (issue #180)

0.1.1
------
Expand Down
16 changes: 16 additions & 0 deletions rioxarray/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ def __init__(self, xds: DataArray):
res = xds.rio.resolution(recalc=True)
self.res = (abs(res[0]), abs(res[1]))
self.transform = xds.rio.transform(recalc=True)
try:
rio_file = xds._file_obj.acquire()
self.profile = rio_file.profile
self.colormap = rio_file.colormap
except AttributeError:
self.profile = {}

def colormap(_):
return None

self.colormap = colormap
self.profile.update(
dtype=xds.dtype,
crs=xds.rio.crs,
nodata=xds.rio.nodata,
)

def read(self, window, out_shape, *args, **kwargs) -> numpy.ma.array:
# pylint: disable=unused-argument
Expand Down

0 comments on commit e4fcdd8

Please sign in to comment.