Skip to content

Commit

Permalink
Use 1-based indexing in infoSet
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Dec 20, 2023
1 parent 12b1b1f commit a225393
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sources/gdal/large_image_source_gdal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sources/rasterio/large_image_source_rasterio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {

This comment has been minimized.

Copy link
@manthey

manthey Dec 20, 2023

Member

This i is already 1 indexed.

This comment has been minimized.

Copy link
@annehaley

annehaley Dec 20, 2023

Author Collaborator

Oh, so this change should only go in the GDAL source's copy?

This comment has been minimized.

Copy link
@manthey

manthey Dec 20, 2023

Member

Right. The gdal code does for i in range(dataset.RasterCount):, where as the rasterio code does for i in dataset.indexes: # 1 indexed.

k: v for k, v in info.items()
if v not in (None, '') and not (
isinstance(v, float) and
Expand Down

0 comments on commit a225393

Please sign in to comment.