def compare_extent(extent0, extent1):
    """Compare and show the difference between two Raster extents
    extent0, extent1: objects or extent dicts to be compared
    displaye: whether to show the extent in figures
    Return:
        0 extent0>=extent1
        1 extent0<extent1
        2 extent0 and extent1 have intersections
    """
    logic_left = extent0[0] <= extent1[0]
    logic_right = extent0[1] >= extent1[1]
    logic_bottom = extent0[2] <= extent1[2]
    logic_top = extent0[3] >= extent1[3]
    logic_all = logic_left + logic_right + logic_bottom + logic_top
    if logic_all == 4:
        output = 0
    elif logic_all == 0:
        output = 1
    else:
        output = 2
        print(extent0)
        print(extent1)
    return output
