[R-sig-Geo] Forcing use of alpha-band in RGBA, as alpha for other bands in plotRGB

T C Wilkinson open @end|ng |rom tobyw||k|n@on@co@uk
Thu Aug 15 16:43:16 CEST 2019


Can one ensure that the alpha-band (i.e. band 4) of an RGBA RasterBrick is applied as a mask when using plotRGB(my_brick)? 

I have a GeoTIFF with an alpha-band marking an irregularly-shaped mask, which displays correctly in QGIS (using band 4 as transparency, values either simply 0 for mask or 255 for visible), but I cannot get plotRGB to display the masked area as anything other than black (which simply means that RGB bands 1,2,3 all =0, and that the alpha mask is being ignored). 

summary(my_brick) acknowledges the presence of the 4th band, and plot(my_brick[[4]]) shows the correctly-shaped mask. 

I hope there is a blindingly obvious solution to this, but have singularly failed to find anything to help me via normal web searches or from the manual. 

(Reclassification is not ideal given that this particular raster is very large and eats memory). 

Thank you in advance, 
Toby


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list