From a225393f8068b4030f463b34d7823b51772ebbd3 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Wed, 20 Dec 2023 15:12:25 -0500 Subject: [PATCH] Use 1-based indexing in infoSet --- sources/gdal/large_image_source_gdal/__init__.py | 2 +- sources/rasterio/large_image_source_rasterio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/gdal/large_image_source_gdal/__init__.py b/sources/gdal/large_image_source_gdal/__init__.py index 865c2f91e..52061d60a 100644 --- a/sources/gdal/large_image_source_gdal/__init__.py +++ b/sources/gdal/large_image_source_gdal/__init__.py @@ -561,7 +561,7 @@ def getBandInformation(self, statistics=True, dataset=None, **kwargs): if band.GetMaskBand(): info['maskband'] = band.GetMaskBand().GetBand() or None # Only keep values that aren't None or the empty string - infoSet[i] = { + infoSet[i + 1] = { k: v for k, v in info.items() if v not in (None, '') and not ( isinstance(v, float) and diff --git a/sources/rasterio/large_image_source_rasterio/__init__.py b/sources/rasterio/large_image_source_rasterio/__init__.py index 409a8e130..643df7b80 100644 --- a/sources/rasterio/large_image_source_rasterio/__init__.py +++ b/sources/rasterio/large_image_source_rasterio/__init__.py @@ -481,7 +481,7 @@ def getBandInformation(self, statistics=True, dataset=None, **kwargs): # info["maskband"] = dataset.mask_flag_enums[i - 1][1].value # Only keep values that aren't None or the empty string - infoSet[i] = { + infoSet[i + 1] = { k: v for k, v in info.items() if v not in (None, '') and not ( isinstance(v, float) and