I want to visualize an image on the Earth Engine with an opacity ramp such that the low value pixels are completely transparent. Take as as example road intensity. I am trying to make an opacity ramp from fully transparent at 0 to alpha = 0.7 at the max value, ~1000.
The visParams argument in Map$addLayer() takes an opacity argument that is applied to the whole layer and accepts only a single value. I learned here that the 6-digit hex colour codes can include two additional digits for the alpha value, but this doesn't seem to translate to an opacity gradient when the colours are mapped to the values, while the opacity argument overwrites these hex-coded alpha values.
I am working from within R, using the rgee package:
roads <- ee$ImageCollection("projects/HII/v1/driver/roads")$ select("hii_road_driver")$ filterDate("2020-01-01")$ toBands()$ rename("roads_2020") Map$addLayer(roads$select("roads_2020"), visParams = list(min = 0, max = 1000, palette = c("#FFFFFF01", "#8B225270")), name = "raods")