-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add interface that allows users to change the color palette of layers while viewing a Cesium map #1798
Comments
Related to #1770 |
Also related to #1768 |
Reorganization of the CesiumWidget: - Move functions that create and update Cesium assets (e.g. imagery, terrain, 3Dtiles) from the CesiumWidget view to individual "Map Asset" models - Replace the Layer and Terrain model with a more generic MapAsset model. - Similarly, replace Layers and Terrains collections with a MapAssets collection that can be used in either case. New features: - Enable clicking on individual features in a 3D tileset lay to view more details - Add support for configuring the colours to use for 3D tilesets - colors can be set conditionally in the Cesium config based on feature properties. Only categorical color palettes are enabled at so far. - Add support for configuring 'vector filters' in the Cesium config. These filters conditionally show or hide features of a 3D tileset based on properties of the features. Relates to #1770, #1798, #1789, #1790, #1791, #1780, #1778, #1797
This topic came up in different meetings this week so I want to document and continue the discussion here: @mbjones mentioned that the color of the PNG tiles can't be changed, so the tiles will need to be regenerated upon user config, which isn't feasible on the fly. Anna later had a good thought that we can generate a few sets of tiles using several predefined color schemes. The config on portal would let users choose among these color schemes for each layer. This would solve two problems: 1. color collision as we add more layers, and 2. one roadblock to full automation Questions:
|
We may be able to skip the PNG layer altogether now, as I have seen some discussion as of mid-2023 that Cesium can now directly render GeoTIFF layers with the This would provide a tremendous boost in functionality, and lower our processing needs by eliminating the png layers. See conversation at: CesiumGS/cesium#6332 (comment) Here's an example from the API Documentation for setting custom colors in the JS: TIFFImageryProvider.fromUrl(YOUR_TIFF_URL, {
renderOptions: {
single: {
"colors": [
[1, "rgb(154, 206, 127)"],
[2, "rgb(163, 214, 245)"],
[3, "rgb(255, 251, 177)"],
[4, "rgb(193, 114, 97)"],
[5, "rgb(220, 100, 120)"],
[6, "rgb(49, 173, 105)"]
],
type: "discrete",
useRealValue: true // use real value in colors stops
}
}
}); |
Oh, and @robyngit @yvonnesjy I'm not sure how well this Cesium TIFF library has been tested -- we'd need to vet it before heading too far down this route -- but promising! |
That's great for single GeoTiffs, but for displaying data across the entire arctic, wouldn't GeoTiffs generally be way too large? I thought that one of the advantage of PNGs for this purpose was their small filesize. Is there a way to create GeoTiffs that are equally as small? |
You can (and we do) tile geotiffs just like you do PNGs. So no difference there (we'd need to create the tile pyramid though). You can also create Cloud-Optimized GeoTIFFs (COGs) that are web-addressable on a per-tile chunk basis, making it possible to make efficient web requests for specific tiles from a much larger whole. And COGs can provide "overviews" that represent a tile pyramid to get lower-resolution views of the same data. Lots of work going on in this space over the last several years, and there are a bunch of great overviews/tutorials on it on the interwebs. |
FYI @hngrtr- rendering arbitrary colors configured through the UI might be a possibility. |
I spent some time trying to get the TIFFImageryProvider to work, and it does work well to load a single GeoTIFF, but there will be a good amount of work to try to build a provider that will issue requests for individual tiles. Right now this library seems to handle tiling for single COGs. I tried, and was not able to get an MVP working for requesting multiple GeoTIFFs. There is an issue on that library mentioning the same idea. |
Some data layers in Cesium will have additional attributes (beyond their coordinates) that we can use to colour-code the associated markers or polygons. For example, we could shade polygons according to an "area" attribute, or colour location markers by a "year" attribute.
A single data layer could have multiple attributes, some of which we would want to use for colour coding, some of which are not relevant (e.g. "Identifier"). A user viewing the map should be able to switch between relevant attributes.
We also need a way to indicate to Cesium which properties of a data layer should be colour-coded, and what kind of scale to use (e.g. a categorical or continuous? sequential or diverging?)
We should use scientifically derived colour palettes when implementing this, see Crameri, F., Shephard, G.E. & Heron, P.J. The misuse of colour in science communication. Nat Commun 11, 5444 (2020).
The text was updated successfully, but these errors were encountered: