ValueError: Input shapes do not overlap raster.

Serigne Mansour DIENE

Good evening to all,

I want to make a mask on 8 images that do not touch each other.
I have vector layers on each image (total 90 vector layers for the 8 images). In each raster I have at least 12 shapefiles. I want to retrieve the average value of a strip.
My rasters and shapefiles are in the same projection (EPSG: 4326) but I still have this error.

Serigne Mansour DIENE
Géomètre Topographe
PhD. Student Remote Sensing 
Tel,: 77-587-74-67

Brandon Victor

You don't show the error you are getting. Specifically, you don't show what line the error is being thrown.

As far as I can see, you have some list of features in `features`, and a list of tif filenames in `list_fichier1`. Then, you have two nested loops. That is, for every image, you try to make a mask for every feature. The error is telling you that there are some features which don't overlap with all images. This makes sense, right?

What can you do? Depends what you need. Here are some options:

1. Don't use crop=True. Uses up more memory, but is simple.
2. Use something like `np.zeros(*crop_size)` as a default and wrap the offending line in a `try/catch`.