def get_overview_data(fn, band_index=1, level=-1):
    ds = gdal.Open(fn)
    band = ds.GetRasterBand(band_index)
    if level > 0:
        ov_band = band.GetOverview(level)
    else:
        num_ov = band.GetOverviewCount()
        ov_band = band.GetOverview(num_ov + level)
    return ov_band.ReadAsArray()
Returns an array containing data from an overview.
dataset/ETHPy150Open cgarrard/osgeopy-code/Chapter13/listing13_5.py/get_overview_data