Skip to content

Commit

Permalink
Merge pull request #1655 from girder/rasterio-stats
Browse files Browse the repository at this point in the history
Handle a rasterio deprecation
  • Loading branch information
manthey authored Sep 30, 2024
2 parents f051161 + c87c65e commit 79808b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- Reduce updates when showing item lists; add a waiting spinner ([#1653](../../pull/1653))
- Update item lists check for large images when toggling recurse ([#1654](../../pull/1654))

### Changes

- Handle a rasterio deprecation ([#1655](../../pull/1655))

### Bug Fixes

- Fix styling images with empty tile layers ([#1650](../../pull/1650))
Expand Down
5 changes: 4 additions & 1 deletion sources/rasterio/large_image_source_rasterio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ def getBandInformation(self, statistics=True, dataset=None, **kwargs):
for i in dataset.indexes: # 1 indexed

# get the stats
stats = dataset.statistics(i, approx=True, clear_cache=True)
if hasattr(dataset, 'stats'):
stats = dataset.stats(indexes=[i], approx=True)[0]
else:
stats = dataset.statistics(i, approx=True, clear_cache=True)

# rasterio doesn't provide support for maskband as for RCF 15
# instead the whole mask numpy array is rendered. We don't want to save it
Expand Down

0 comments on commit 79808b6

Please sign in to comment.