-
Notifications
You must be signed in to change notification settings - Fork 181
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
Comments
Hello, you could try https://github.com/GeoTIFF/geotiff-palette and see if it helps in your use case? |
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 :) |
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 |
So I would I read the palette to pass it to a style? |
image.fileDirectory.ColorMap |
If your goal is to color your COG then the library already includes the required functionality if you use the geotiff.js/src/geotiffimage.js Line 646 in 4af107d
Note that if you use this library behind OpenLayers you may run into this issue: openlayers/openlayers#15894 |
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.
The text was updated successfully, but these errors were encountered: