def matching_spatref(osr_a, osr_b):
    """Test if two spatial reference objects match

    Args:
        osr_a: OSR spatial reference object
        osr_b: OSR spatial reference object

    Returns:
        Bool: True if OSR objects match. Otherwise, False.

    """
    osr_a.MorphToESRI()
    osr_b.MorphToESRI()
    if ((osr_a.GetAttrValue('GEOGCS') == osr_b.GetAttrValue('GEOGCS')) and
        (osr_a.GetAttrValue('PROJECTION') == osr_b.GetAttrValue('PROJECTION')) and
        (osr_a.GetAttrValue('UNIT') == osr_b.GetAttrValue('UNIT')) and
        (osr_a.GetUTMZone() == osr_b.GetUTMZone())):
        return True
    else:
        return False