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

Support classified color palettes in the Cesium map #1953

Open
robyngit opened this issue Feb 2, 2022 · 0 comments
Open

Support classified color palettes in the Cesium map #1953

robyngit opened this issue Feb 2, 2022 · 0 comments
Labels
cesium enhancement pdg Permafrost Discovery Gateway portals Anything related to portals

Comments

@robyngit
Copy link
Member

robyngit commented Feb 2, 2022

Colors for 3D tileset layers are set in the Cesium config using the colorPalette property.

categorical colorPalette example
"colorPalette": {
  "paletteType": "categorical",
  "property": "Type",
  "label": "Zone type",
  "colors": [
    {
      "value": "Climate-driven",
      "color": "#FF3720"
    },
    {
      "value": "Climate-driven/ecosystem-modified",
      "color": "#0370FE"
    },
    {
      "value": "Climate-driven/ecosystem protected",
      "color": "#BFD1FF"
    },
    {
      "value": "Ecosystem-driven",
      "color": "#4DE603"
    },
    {
      "value": "Ecosystem-protected",
      "color": "#267301"
    },
    {
      "value": null,
      "color": "#ffffff"
    }
  ]
}

In the example above, paletteType is set to categorical. This type means that each feature's property must exactly match the the value for the feature to be shaded with the corresponding color. Only categorical and continuous palettes (#1952) are supported so far.

This issue encompasses adding support for classified color palettes. - classified color palettes are for numeric properties like area and height, but the palette is discrete instead of a continuous gradient. That means that the configured values would be interpreted as maximums, and any values less than the given value would be "binned" into a discrete color category. This differs from the categorical palette in that the features' property values do not need to exactly match the configured color value, e.g.:

Screen Shot 2021-09-29 at 11 39 38

Notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cesium enhancement pdg Permafrost Discovery Gateway portals Anything related to portals
Projects
None yet
Development

No branches or pull requests

1 participant