def get_intersecting_tile_names(bounds_csv_path, aoi_path):
    print('Finding all the intersecting tile names')
    aoi_df = gpd.read_file(aoi_path)
    if (aoi_df.crs != 28992):
        aoi_df = aoi_df.to_crs(epsg=28992)
    tile_names_list = []
    tiles_bounds_df = pd.read_csv(bounds_csv_path)
    for i in tqdm(range(len(tiles_bounds_df))):
        tile_name = tiles_bounds_df['tile_name'].iloc[i]
        tile_left = tiles_bounds_df['left'].iloc[i]
        tile_right = tiles_bounds_df['right'].iloc[i]
        tile_bottom = tiles_bounds_df['bottom'].iloc[i]
        tile_top = tiles_bounds_df['top'].iloc[i]
        tile_poly = gpd.GeoSeries([Polygon([(tile_left, tile_bottom), (tile_right, tile_bottom), (tile_right, tile_top), (tile_left, tile_top)])])
        tile_df = gpd.GeoDataFrame({'geometry': tile_poly, 'df1': [1]}, crs='EPSG:28992')
        if aoi_df.intersects(tile_df).any():
            tile_names_list.append(tile_name)
    print('the intersecting tiles are ', tile_names_list)
    return tile_names_list
def get_intersecting_tile_names(bounds_csv_path, aoi_path):
    print('Finding all the intersecting tile names')
    aoi_df = gpd.read_file(aoi_path)
    if (aoi_df.crs != 28992):
        aoi_df = aoi_df.to_crs(epsg=28992)
    tile_names_list = []
    tiles_bounds_df = pd.read_csv(bounds_csv_path)
    for i in tqdm(range(len(tiles_bounds_df))):
        tile_name = tiles_bounds_df['tile_name'].iloc[i]
        tile_left = tiles_bounds_df['left'].iloc[i]
        tile_right = tiles_bounds_df['right'].iloc[i]
        tile_bottom = tiles_bounds_df['bottom'].iloc[i]
        tile_top = tiles_bounds_df['top'].iloc[i]
        tile_poly = gpd.GeoSeries([Polygon([(tile_left, tile_bottom), (tile_right, tile_bottom), (tile_right, tile_top), (tile_left, tile_top)])])
        tile_df = gpd.GeoDataFrame({'geometry': tile_poly, 'df1': [1]}, crs='EPSG:28992')
        if aoi_df.intersects(tile_df).any():
            tile_names_list.append(tile_name)
    print('the intersecting tiles are ', tile_names_list)
    return tile_names_list