I'm reading a window of a tif using rasterio. How do I utilize the available overviews to get a down-sampled version of the data instead of reading at the true resolution?
Right now I am reading a window like this:
rmin, cmin = source.index(xmin, ymin)
rmax, cmax = source.index(xmax, ymax)
data = source.read(band, window=((rmax, rmin), (cmin, cmax)))
What I want to do:
rmin, cmin = source.index(xmin, ymin, use_overview=True)
rmax, cmax = source.index(xmax, ymax, use_overview=True)
data = source.read(band, window=((rmax, rmin), (cmin, cmax)), use_overview=True)
Any ideas? Note that in my case the overviews are internal, but any solution which reads off of overviews is great.