What is the raster merge criteria algorithm on rasterio.merge?

Eduardo <eduardosteps@...>

I'm creating a mosaic from many sentinel images with a bunch of overlapping areas, although I'm trying to understand what is criteria. For example:

This is a small piece totally clear of clouds


And this is a larger piece with many clouds


This is the result of the merge using rasterio.merge

I used rasterio.merge. It brings me a result where the most recent acquired image prevails, but don't understand the algorithm method yet. How can I tell the code to keep the image with fewer clouds as possible? Which method are this algorithm using to preserve the earlier raster and not the cleanest (no clouds)?

It would be absolutely awesome if I could select the raster with fewer clouds based in pixel values, for insance, to be merged for this mosaic. Is there a way to choose them?

Join main@rasterio.groups.io to automatically receive all group messages.