Forcing use of alpha-band in RGBA, as alpha for other bands in plotRGB

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Forcing use of alpha-band in RGBA, as alpha for other bands in plotRGB

T C Wilkinson
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]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo