Description
The COG style editor (web/client/plugins/styleeditor/MultiBandEditor.jsx) is limited and its render mode is decided automatically from file metadata, with no user override.
Main needed improvements:
- The render mode (RGB vs single band) is inferred, not selectable. A multi band COG is always forced into an RGB composite. We should allow selection of render mode. So when
sourceMetadata option is missing, the editor will not silently assumes an RGBA image.
- Allow selection of single band rendering from a multi band COG.
- Implement simple single band pseudo color (color ramp) support.
- Allow min/max stretch for each band of an RGB composite independently.
- Extract bands list from the metadata when possible, at the moment it assumes by default 4 bands maximum.
Proposal
Keep the OpenLayers style.body.color expression as the single representation of the COG styling.
Editor changes (MultiBandEditor.jsx)
- Add an explicit render mode selector: RGB composite, Single band (gray), Single band (pseudo color). Always available, metadata detection only select the default.
- Fix single band selection so any band can be chosen from a multi band COG.
- Add an option in per band stretch for the RGB composite mode (R, G, B each get their own min/max). The default keeps raw band references with a single global min/max, so the renderer auto scales and the image stays visible even without statistics..
- Add a basic pseudo color ramp reusing
components/styleeditor/ColorRamp.jsx. (Let's try to reuse same color ramps available in the vectorstyleeditor classification)
- Build the band list from
sourceMetadata.samples instead of a hardcoded array.
- When metadata is missing: fetch it on demand via
utils/cog/LayerUtils.js and enrich the layer while on failure show a manual fallback.
Cesium changes (components/map/cesium/plugins/COGLayer.js)
Rewrite buildRenderOptions function to parse properly style.body.color into the tiff-imagery-provider render options
OpenLayers renderer
No changes needed because it already uses style.body directly.
Known limitations
Some options may not be supported inside the Cesium tiff-imagery-provider library, in this case we should disable fields in the editor UI. IN the initial analysis we verified that the alpha channel is not supported in the multi band style of tiff-imagery-provider so we should disable it in 3D mode.
Legend
We will need a legend representation in particular with the introduction of the pseudo color mode:
- pseudo color, vertical linear gradient with tick labels based on number of classes
- gray, vertical black and white gradient with just min and max value
- rgb, no legend
When is not possible to create legend it will not be represented
Mock
Note: names may change during development (e.g render modes)
What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information
Description
The COG style editor (
web/client/plugins/styleeditor/MultiBandEditor.jsx) is limited and its render mode is decided automatically from file metadata, with no user override.Main needed improvements:
sourceMetadataoption is missing, the editor will not silently assumes an RGBA image.Proposal
Keep the OpenLayers
style.body.colorexpression as the single representation of the COG styling.Editor changes (
MultiBandEditor.jsx)components/styleeditor/ColorRamp.jsx. (Let's try to reuse same color ramps available in the vectorstyleeditor classification)sourceMetadata.samplesinstead of a hardcoded array.utils/cog/LayerUtils.jsand enrich the layer while on failure show a manual fallback.Cesium changes (
components/map/cesium/plugins/COGLayer.js)Rewrite
buildRenderOptionsfunction to parse properlystyle.body.colorinto thetiff-imagery-providerrender optionsOpenLayers renderer
No changes needed because it already uses
style.bodydirectly.Known limitations
Some options may not be supported inside the Cesium
tiff-imagery-providerlibrary, in this case we should disable fields in the editor UI. IN the initial analysis we verified that the alpha channel is not supported in the multi band style oftiff-imagery-providerso we should disable it in 3D mode.Legend
We will need a legend representation in particular with the introduction of the pseudo color mode:
When is not possible to create legend it will not be represented
Mock
Note: names may change during development (e.g render modes)
What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information