From 5c36de1f2ee4e008fd49e3a4bae94389ba7afe02 Mon Sep 17 00:00:00 2001 From: Sudipta Basak Date: Thu, 3 Aug 2023 16:07:32 +1000 Subject: [PATCH] bugfix for cog --- configs/ref_rf.yaml | 6 +++--- uncoverml/geoio.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/ref_rf.yaml b/configs/ref_rf.yaml index b2285810..4d76ea8e 100644 --- a/configs/ref_rf.yaml +++ b/configs/ref_rf.yaml @@ -75,9 +75,9 @@ prediction: quantiles: 0.95 outbands: 4 geotif_options: - TILED: YES - BLOCKXSIZE: 256 - BLOCKYSIZE: 256 +# TILED: YES +# BLOCKXSIZE: 256 +# BLOCKYSIZE: 256 driver: COG validation: diff --git a/uncoverml/geoio.py b/uncoverml/geoio.py index ae842371..7235295a 100644 --- a/uncoverml/geoio.py +++ b/uncoverml/geoio.py @@ -340,9 +340,9 @@ def __init__(self, shape, bbox, crs, name, n_subchunks, outputdir, file_names = [] if mpiops.chunk_index == 0: + driver = kwargs.pop('driver') if 'driver' in kwargs else 'GTiff' for band in range(self.outbands): output_filename = os.path.join(outputdir, name + "_" + file_tags[band] + ".tif") - driver = kwargs.pop('driver') if 'driver' in kwargs else 'GTiff' f = rasterio.open(output_filename, 'w', driver=driver, width=self.shape[0], height=self.shape[1], dtype=np.float32, count=1,