def Get_epsg(g):
    """
    This function reads the projection of a GEOGCS file or tiff file

    Keyword arguments:
    g -- string
        Filename to the file that must be read
    extension -- tiff or GEOGCS
        Define the extension of the dataset (default is tiff)
    """
    try:
        g_proj = g.GetProjection()
        Projection = g_proj.split('EPSG","')
        epsg_to = int(str(Projection[-1]).split(']')[0][0:-1])
    except:
        epsg_to = 4326
    return epsg_to
