|
ImageMosaic with a 40x40 Red square geotiff centered at -10,-10 and a Blue square geotiff centered at 10, 10. Each geotiff has a wkt footprint file specifying a 20x20 hole in the center of the square. Normally, this works fine, producing a geotiff where the lower square can be seen through the hole in the upper square (see screenshot mosaic_rgb). However, if an alpha channel is added to the two geotiff files, the JAI moisaic operation does not work correctly, such that the lowwer square is not visible through the hole (see screenshot mosaic_rgba).
Stepping through in a debugger, it looks like the footprints are not being properly applied by the JAI operation when an alpha channel is present in the source (Note that an alpha mask is apllied after the mosaic operation, resulting in the transparent regions that do show up - immediately after the mosaic operation, the image looks like two overlapping squares with no transparency. I have tried fixing this by using the ImageWorker class to remove the alpha channel from the source images, without success. I suspect there is some relevant metadata in the RenderedOp used for the source image that is being lost when I try to remove the alpha channel.
A test case demonstrating this failure can be found here: https://github.com/tbarsballe/geotools/commit/b4c54b5f3997aaf03b945d5a36a4206cbffa5b9f
|