Skip to content
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

Working with Multibandraster #115

Open
Lorano98 opened this issue Dec 1, 2022 · 1 comment
Open

Working with Multibandraster #115

Lorano98 opened this issue Dec 1, 2022 · 1 comment

Comments

@Lorano98
Copy link

Lorano98 commented Dec 1, 2022

    @khannurien , how many bands does your raster have?

If it's a simple 3-Band RGB raster you could do:

pixelValuesToColorFn: values => values[0] === -99.0 ? null : `rgb(${values[0]},${values[1]},${values[2]})`

If it's a four-band RGBA raster, you could do:

pixelValuesToColorFn: values => values[0] === -99.0 ? null : `rgba(${values[0]},${values[1]},${values[2]},${values[3]/255})`

If it's not 3 or 4-bands, things get more complicated, but I'm happy to help.

Please let me know if it works or if you have any other questions. I'd like to improve the documentation to make it more clear. Thanks!!

Originally posted by @DanielJDufour in #16 (comment)


As you mentioned above it is complicated to handle rasters with more than 4 bands. But how can i do that? My raster has 10 bands.

@pgenevski
Copy link

Do you mean converting a 10 band pixel to a 3 band (RGB) pixel, or something like calculating e.g. an NDVI out of some of the bands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants