I want to select only the raster files that overlap or intersect my AOI. I have a list of 900 raster files, and I calculate their footprints. Besides, I have my AOI.
Both, the footprints and the AOI are GeoDataFrames. I have troubles constructing my if statement. How can I check if two GeoDataFrames intersect with GeoPandas?
intersect_footprints = []
AOI = load_vector("AOI.geojson")
footprint = import_files("footprints.geojson")
if footprint["geometry"].intersects(AOI["geometry"]):
intersected_raster.append(files_path)
I have an error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()