Replies: 3 comments 1 reply
-
That is a rasterio function not rioxarray...so you would have to make rasterio available and use that I think? |
Beta Was this translation helpful? Give feedback.
0 replies
-
It would be cool for rioxarray/rasterio to support numpy style of -ve indexing for overviews, with -1 meaning highest available overview level, that way one can avoid double open for some common use cases. |
Beta Was this translation helpful? Give feedback.
1 reply
-
import rasterio
import rioxarray
https_url = 'https://s3.us-west-2.amazonaws.com/prod-is-usgs-sb-prod-publish/618e83cad34ec04fc9caa715/South_Carolina_CoNED_Topobathy_DEM_1m.tif'
with rasterio.open(https_url) as rds:
max_overview_level = len(rds.overviews(1)) - 1
da = rioxarray.open_rasterio(https_url, overview_level=max_overview_level) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
snowman2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out how to find the maximum overview level in a COG, and I see the function here:
https://rasterio.readthedocs.io/en/stable/api/rasterio.rio.overview.html#rasterio.rio.overview.get_maximum_overview_level
but I can't figure out how to use it.
I thought this would work, but it doesn't:
Beta Was this translation helpful? Give feedback.
All reactions