-
Notifications
You must be signed in to change notification settings - Fork 18
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
Configure custom color maps in xcube server #1046
Comments
Here is another practical example for Sentinel 2 level 2, scene classification band SCL: CustomColorMaps:
- Identifier: S2_L2_SCL
Type: categorical
Colors:
- [ 0, red, no data]
- [ 1, yellow, defective]
- [ 2, black, dark area pixels]
- [ 3, gray, cloud shadows]
- [ 4, green, vegetation]
- [ 5, tan, bare soils]
- [ 6, blue, water]
- [ 7, "#aaaabb", clouds low prob ]
- [ 8, "#bbbbcc", clouds medium prob]
- [ 9, "#ccccdd", clouds high prob]
- [10, "#ddddee", cirrus]
- [11, "#ffffff", snow or ice] |
@konstntokas, I just tested PR #1055 with a real-life server configuration and I see several problems, therefore I reopened the issue:
I'm sorry that I didn't discover the problems during the PR review which concentrated on plain code review rather than on practical experience. |
Proof for my point 2: [
"Custom",
"Custom colormaps, e.g. loaded from SNAP *.cpd files or defined via the xcube server config file.",
[
[
"s2_l2_scl",
"iVBORw0KGgoAAAA...kSuQmCC",
{
"name": "s2_l2_scl",
"type": "categorical",
"colors": [
[ 0, "red" ], [ 1, "yellow" ], [ 2, "black" ], [ 3, "gray" ], [ 4, "green" ], [ 5, "tan" ], [ 6, "blue" ],
[ 7, "#aaaabb" ], [ 8, "#bbbbcc" ], [ 9, "#ccccdd" ], [ 10, "#ddddee" ], [ 11, "#ffffff" ] ]
}
]
]
] for CustomColorMaps:
- Identifier: s2_l2_scl
Type: categorical
Colors:
- [ 0, red, no data]
- [ 1, yellow, defective]
- [ 2, black, dark area pixels]
- [ 3, gray, cloud shadows]
- [ 4, green, vegetation]
- [ 5, tan, bare soils]
- [ 6, blue, water]
- [ 7, "#aaaabb", clouds low prob ]
- [ 8, "#bbbbcc", clouds medium prob]
- [ 9, "#ccccdd", clouds high prob]
- [10, "#ddddee", cirrus]
- [11, "#ffffff", snow or ice] |
No problem; I was thinking about the levels at one point, but then forgot about them as well. The rest mainly comes from the fact that I took the
I suggest to move |
Ok.
Ok, but not now. Please apply the changes for
Don't do that. Color maps must be identified through their identifier, independently of their type or origin. |
Not now. |
@konstntokas please create a new issue afterwards for a more consistent handling of color maps from SNAP CPD files. |
see #1058 |
Colors defined as RGB are making problems in the viewer due to the viewer only accepts uint8 value range (0-255) and not 0-1 ranges. See xcube-dev/xcube-viewer#392 (comment) To fix this, all RGBs are converted to HEX. Note that |
Is your feature request related to a problem? Please describe.
Since xcube 1.6, xcube server accepts custom color maps from xcube viewer. We want to allow configuring the same type of custom color maps in xcube server, namely
Describe the solution you'd like
EDIT:
An entry in the in the
Colors
list may have one of the following forms (TypeScript notation):The text was updated successfully, but these errors were encountered: