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

how dow I read colur palette from a COG? #378

Open
pitommasi opened this issue Jul 29, 2023 · 5 comments
Open

how dow I read colur palette from a COG? #378

pitommasi opened this issue Jul 29, 2023 · 5 comments

Comments

@pitommasi
Copy link

I need to display some COG using OpenLayers. So far I managed to do so but I had to specify the palette separately.
Since the COG I'm using have the colormap already embedded (https://rasterio.readthedocs.io/en/latest/topics/color.html#writing-colormaps), I've been wondering whether there was a way to extract it dynamically from the COG instead of hardcoding it in the JS code.

@DanielJDufour
Copy link
Contributor

Hello, you could try https://github.com/GeoTIFF/geotiff-palette and see if it helps in your use case?

@pitommasi
Copy link
Author

Hi, thanks, I'll give it a go... I asked the same question there but didn't get a reply, hence, I've asked here :)

@constantinius
Copy link
Member

The palette is stored in a TIFF Tag ColorMap.

We expose RGB reading using palettes in the GeoTIFF Image class and pass it to the fromPalette function. There is currently no predefined function to do so, but everything is accesible, I believe.

@pitommasi
Copy link
Author

pitommasi commented Jul 31, 2023

So I would I read the palette to pass it to a style?
I mean, I know how to pass it to the style, eventually, but how do I retrieve it?

@constantinius
Copy link
Member

image.fileDirectory.ColorMap

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

3 participants