-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Accessing COG overviews with read_rasterio #3269
Comments
That kwarg looks good to me. Can you send in a PR? |
@dcherian I was just revisiting a use-case for this and realized I think this would be easy to implement because a while back rasterio implemented a keyword argument so that you can do rasterio.open(path, overview_level=3) So is this just a matter of accepting kwargs in xr.open_rasterio() and passing them through? xarray/xarray/backends/rasterio_.py Line 241 in 4aa7622
As seems to be done here for example: xarray/xarray/backends/h5netcdf_.py Line 164 in cc271e6
|
looks right to me. Let's try it! |
It's considered best practice to create cloud-optimized geotiff (COG) with overviews, which are essentially copies of the dataset at different resolutions to allow fast representation at different scales.
It would be nice if we could pick a specific overview using
xr.read_rasterio
, perhaps by just an additional parameter on the call, likexr.read_rasterio(url, overview=512)
or something.Currently we need to use Rasterio to find out what the overlays are, for example:
which results in:
See the notebook here for the hack workaround to extract an overlay from COG:
https://nbviewer.jupyter.org/gist/rsignell-usgs/dc4cf94fae97d085f6f2b9b896ec5336
The text was updated successfully, but these errors were encountered: