How to pass custom colormaps with float values? #496
-
Hi, I am trying to pass the following colormap for visualizing in NDVI using the stac endpoint. This is my url format that I am using to request tiles:
In the above url, I have encode the following colormap in json:
IssueI am getting internal server 500 response when requesting tiles with the above color map & url format. To be more detailed, this is the response for 500 status code titiler: Is it unable to accept float values as key to each color? Because that is what the error seems like. Would really love some clarity on how do we pass NDVI/other color maps that use a similar scale (-1,1) using titiler's endpoint. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@neelduttahere |
Beta Was this translation helpful? Give feedback.
-
@vincentsarago , I'm curious about intermediate alpha values - it appears that values >= 1 for alpha render at full opacity like 255. Is there something that prevents use of intermediate values for partial transparency, e.g. 128 for half transparent? |
Beta Was this translation helpful? Give feedback.
@neelduttahere
Discrete
colormap assign RGBA color to an integer while you are trying to assign it to a float value. What you want to use isinterval
colormap https://cogeotiff.github.io/rio-tiler/colormap/#intervals-colormapshttps://github.com/developmentseed/titiler/blob/master/src/titiler/core/tests/test_factories.py#L136-L148