Skip to content

Commit

Permalink
fix array ref
Browse files Browse the repository at this point in the history
  • Loading branch information
dugalh committed Feb 20, 2024
1 parent 989129c commit 5f52ced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homonim/raster_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def to_file(self, filename: Union[str, pathlib.Path], driver: str = 'GTiff', **k
"""
with rio.Env(GDAL_NUM_THREADS='ALL_CPUs', GTIFF_FORCE_RGBA=False):
with rio.open(filename, 'w', driver=driver, **self.profile, **kwargs) as out_im:
out_im.write(array, indexes=range(1, self.count + 1) if self.count > 1 else 1)
out_im.write(self._array, indexes=range(1, self.count + 1) if self.count > 1 else 1)
if out_im.nodata is None:
out_im.write_mask(self.mask)

Expand Down

0 comments on commit 5f52ced

Please sign in to comment.