def get_extent(fn):
    ds = gdal.Open(fn)
    gt = ds.GetGeoTransform()
    return (gt[0], gt[3], gt[0] + gt[1] * ds.RasterXSize,
        gt[3] + gt[5] * ds.RasterYSize)
Returns min_x, max_y, max_x, min_y
dataset/ETHPy150Open cgarrard/osgeopy-code/Chapter10/ch10funcs.py/get_extent