gjoseph92 / stackstac

Turn a STAC catalog into a dask-based xarray
https://stackstac.readthedocs.io
MIT License
232 stars 49 forks source link

Fix black stripes when mosaicing without nodata #219

Closed gjoseph92 closed 11 months ago

gjoseph92 commented 11 months ago

When a GeoTIFF doesn't have a nodata value, and we use a VRT, GDAL fills in 0s for pixels outside the bounds. However, read(masked=True) doesn't mask these 0s, so they're left in as valid data.

Using add_alpha in the VRT, we get an extra explicit alpha band to use as the mask.

Closes #217.