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

[Bug] Categorical Colormaps Failing #1456

Open
acblackford opened this issue Feb 11, 2025 · 4 comments
Open

[Bug] Categorical Colormaps Failing #1456

acblackford opened this issue Feb 11, 2025 · 4 comments
Assignees
Labels
P2 Find a way to fix in the next few sprints

Comments

@acblackford
Copy link

acblackford commented Feb 11, 2025

Context

Datasets with categorical colormap renders are not being displayed in the dashboard. Selecting predefined colormap names for the renders do work, however. This does not throw any errors, and allows for a preview to deploy when working on a config PR, but the dataset will not populate in a story visualization or in the exploration/dataset tabs.

URL:

Blocking a release? (y/n): y

Regression issue? (y/n):
[If yes, add Regression label]

Priority: P2

Steps to reproduce the issue

  1. Example sourceParams markdown (also issue in renders):
    colormap: '{"6":"#1e90c9", "12":"#ab94d6", "18": "#5a1680", "24": "#d943d4"}'

does not populate the dataset.

Selecting a markdown with colormap name:

colormap_name: blues_r

works as intended.

@hanbyul-here
Copy link
Collaborator

hanbyul-here commented Feb 12, 2025

Can you share the complete configuration for this layer? We expect some flags for categorical legend work, and I'd like to check them.

@anayeaye
Copy link

I have looked at a few different working and not working categorical colormaps. Here are some notes and examples:

Notes
There are a couple ways that categorical colormaps are handled: for simple mappings, the colormap can be defined in the sourceParams directly (example: geoglam). For more complicated colormaps that are blocked by the firewall, we have been creating custom named colormaps in the raster-api that are passed as colormap_name in the sourceParams (example: nlcd). In all working examples colormap or colormap_name the raster tiles for a categorical map do not work properly without a categorical legend in the mdx file--I can work up an example to share.

Examples

collection: geoglam working categorical colormap

collection: soil-texture working colormap_name + categorical legend

collection: nlcd working colormap_name + categorical legend

collection: campfire-nlcd not working, categorical colormap

@aboydnw aboydnw added the P2 Find a way to fix in the next few sprints label Feb 12, 2025
@hanbyul-here
Copy link
Collaborator

Recording some more findings:
There is a discrepancy between staging and production - while staging returns a valid response when the custom colormap value is passed as a hex value, the production returns an invalid response.

Compare staging: https://staging.openveda.cloud/api/raster/searches/46caa563f1a22309ab6d83cbea5ea80a/WebMercatorQuad/tilejson.json?assets=cog_default&colormap=%7B%2211%22%3A%22%23486DA2%22%7D

to production: https://openveda.cloud/api/raster/searches/46caa563f1a22309ab6d83cbea5ea80a/WebMercatorQuad/tilejson.json?assets=cog_default&colormap=%7B%2211%22%3A%22%23486DA2%22%7D

I could work around it by replacing hex value to rgb values

@anayeaye
Copy link

RE staging hex colormaps are working but not prod:

The WAF in production is blocking requests with the AWS#AWSManagedRulesSQLiRuleSet#SQLi_QUERYARGUMENTS rule. The sampled blocked requests are the hex colormaps. We could investigate an exemption for tiles requests if we can identify a safe pattern for that exemption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Find a way to fix in the next few sprints
Projects
None yet
Development

No branches or pull requests

4 participants