diff --git a/Multi-raster.ipynb b/Multi-raster.ipynb new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 57bf20c..2f4dfbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rasters" -version = "1.5.2" +version = "1.5.3" description = "raster processing toolkit" readme = "README.md" authors = [ diff --git a/rasters/raster.py b/rasters/raster.py index a3d7115..4629cbf 100644 --- a/rasters/raster.py +++ b/rasters/raster.py @@ -1325,8 +1325,12 @@ def to_file( if exists(filename) and not overwrite: raise IOError(f"output file already exists: {filename}") - with rasterio.open(filename, "w", **profile) as file: - file.write(output_array, 1) + if len(self.shape) == 2: + with rasterio.open(filename, "w", **profile) as file: + file.write(output_array, 1) + else: + with rasterio.open(filename, "w", **profile) as file: + file.write(output_array) def to_geotiff( self, diff --git a/rasters/version.txt b/rasters/version.txt index 4cda8f1..8af85be 100644 --- a/rasters/version.txt +++ b/rasters/version.txt @@ -1 +1 @@ -1.5.2 +1.5.3