openlayers
openlayers copied to clipboard
Even bandsCount >= 5 in DataTileSource not working correctly
Describe the bug Using even bandsCount >= 6 in DataTileSource generates incorrect output, when using last band as alpha channel. What we try to do
- Set layer style to show RGBA
- {color: ["color",["band", 4],["band", 3],["band", 2],["/", ["band", bands.length + 1], 255]]}
- Ask for 5 bands from titiler - you'll get 6bands (5bands + alpha) as output
- Set DataTileSource to work with 6 bands (5 + alpha)
- Alpha mask is not working correctly
- To fix this behavior we generated ol/DataTile with one more dimension, when working with even bandsCount:
To Reproduce Steps to reproduce the behavior:
- Change value of totalBandsCount (row: 24) directly to bandsCount (In this example it is 6).
Example https://codesandbox.io/s/numpytile-forked-e279im
I also encounter this with a 5 band GeoTIFF (returning 6 bands including the alpha). The workaround there is to explicitly specify the bands and duplicate one of them:
sources: [
{
nodata: 0,
bands; [1, 2, 3, 4, 5, 5],
url: 'xxxx.tif',
},
],