-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Raster Image RGB / multi layer support #212
Comments
I'm surprised the color palette approach didn't work (though inconvenient, I admit). Do you have a reproducible example of what you attempted? |
I have scaled the values of the 3 layers into one layer, containing RGB values (for 8bit images in the range 0:16777215):
Next step would be to create a color palette, that assigns each of these values an RGB color. But I have no clue how to properly do that. Any advice would be great! Edit:
|
I managed to do it, but this is probably the worst code i ever wrote. This colorramp takes ~900MB of RAM, and around 20seconds to calculate on my laptop, so I ended up loading this thing from a Rdata file. |
here's our solution: https://github.com/environmentalinformatics-marburg/mapview/blob/master/R/viewRGB.R The function let's you plot any 3-band combination of your LS image, so false color images are also possible. |
Tim, can you use viewRGB to display color composites as below in leaflet? (as opposed to mapview). If so, can you please provide an example? Thanks! mapview::viewRGB(poppendorf, 4, 3, 2) |
There is currently no A |
Thanks for your quick response. The @Map did the trick. Looking forward to stars! |
Hi,
Can anybody help me? MIKEL |
Sorry for the trouble. This is a bug in the latest mapview release. Should be fixed soon. |
@mikel89larioja this should be fixed now. |
Hi,
I tried to install the package that contains this functions but I cant seem to find it? any ideas? |
@agubas Can you provide a reproducible example using reprex? Thank you! reprex::reprex({
library(leaflet)
# code to reproduce problem
}) |
devtools::install_github("r-spatial/mapview@develop") |
Thanks Tim! minor confusion there |
I am trying to display a 3-band terra rast object as a color composite with |
Answering myself:
Then I use but see #900 (the leaflet display i very poor). |
Actually, using leaflet::addRasterRGB() is a better alternative:
|
I am trying to display an GeoTIFF with 3 Layers (RGB) in leaflet, preserving the true colors.
From my investigations it seems that this is currently not possible, as only single layer raster files are supported:
leaflet::addRasterImage()
only supportsRasterLayer
as input.RasterStack
andRasterBrick
- which (I believe) would enable multi layer support - are not accepted.I also tried to generate a color palette, which would map the "true" colors to the pixels, but had no success.
Is there currently a way to solve this problem?
It would be great, if RGB true color support was integrated in the
addRasterImage()
function.The text was updated successfully, but these errors were encountered: