Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle a rasterio deprecation #1655

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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