Colormap issue #449
-
Using the /cog/tiles/ and /cog/preview/ endpoints, whenever I try adding a color map, I get the following: {"detail":"arrays used as indices must be of integer (or boolean) type"} I've tried an existing color map such as: I've also tried a very basic colormap such as (but urlencoded): Can anyone point out what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Btw, if I view the file via the /cog/viewer/ endpoint, the selectable colormaps work just fine. |
Beta Was this translation helpful? Give feedback.
-
🤦 I think I miss understood the initial question @idtstudios, is it possible that your input data is not of type |
Beta Was this translation helpful? Give feedback.
-
Ah! That was what I was doing wrong. I'm so used to using palettes with gdal that I didn't even notice that. Thank you! I can now easy apply one of the premade colormaps (viridis, etc). However, I am now having a bit of trouble with applying my own. If I provide the following: value 0, 127, and 255 have colors applied but none of the in between values do. I have tried adding the following but they have effect: |
Beta Was this translation helpful? Give feedback.
-
Ah, gotcha. Thank you for taking the time to explain all of this. Much appreciated! |
Beta Was this translation helpful? Give feedback.
🤦 I think I miss understood the initial question @idtstudios,
is it possible that your input data is not of type
Byte
(meaning with value from 0 to 255). If that's the case, colormap won't work because you first need to rescale your data tobyte
(using therescale={min},{max}
parameter), which will create value from 0 to 255. Then you can apply colormap