def get_extent(gt,cols,rows):
    """
    Return list of corner coordinates from a geotransform. This code was taken
    from: http://gis.stackexchange.com/questions/57834/how-to-get-raster-corner-coordinates-using-python-gdal-bindings

    Parameters
    ----------
    gt : tuple or list
        geotransform
    cols : int
        number of columns in the dataset
    rows : int
        number of rows in the dataset

    Returns
    -------
    list of floats
        Coordinates of each corner
    """
    ext=[]
    xarr=[0,cols]
    yarr=[0,rows]

    for px in xarr:
        for py in yarr:
            x=gt[0]+(px*gt[1])+(py*gt[2])
            y=gt[3]+(px*gt[4])+(py*gt[5])
            ext.append([x,y])
#            print x,y
        yarr.reverse()
    return ext