Skip to content

Raster Tile Layer COG as STAC item symbology #3361

@jo-chemla

Description

@jo-chemla

Is your feature request related to a problem? Please describe.
Some context is described here: developmentseed/rio-stac#76: after seeing PR to add Raster Tile support in #3048, I wanted to load a trueColor 8 bits RGB COG on kepler.gl/demo, and currently TiTiler can conveniently serve a STAC item json given a COG url on the /cog/stac?url=COG_URL endpoint.

TiTiler currently stores the bands common_names as eo:bands description in the STAC item built from the COG url, hence the linked feature request on titiler repo. On that thread, Vincent (🙏) quickly replied that

in stac version 1.1.0 band is now part of the core spec and not the eo extension

Describe the solution you'd like

Hence a few questions on kepler-gl way to handle COG :

  • Could keplergl also look for bands common_names in description, and not only in eo:band common_name? Not necessarily very future-proof, please disregard if unwanted, and more of a hack while implementation lands natively in titiler.
  • Parsing through keplergl raster-tile codebase (especially layers/src/raster-tile/raster-tile-utils.ts), it seems only raster:band and eo:band are supported. Regarding the fact that bands are now STAC core spec (not eo:bands or raster:bands anymore), does keplergl support STAC item version >= 1.1.0? See common band product from release notes. Should this be extracted in a package utility or existing library (from loaders, deckgl or js bindings eg moregeo/stac-js findVisualBands (stac-browser migrated to stac-js))
  • If the codepath to check whether preset trueColor can be offered in the UI, and returns false because not all bands (red, green, blue) are present as common_names, could the preset still be offered, to let the user choose which bands to use as R, G, B channels? Could even make sense for any multi-band color preset, like Agriculture, letting the user enforce a given band combination as NIR, Red, Green as RGB.
    trueColor: {
    label: 'True Color',
    id: RasterTileLayerPresets.trueColor,
    bandCombination: BandCombination.Rgb,
    commonNames: ['red', 'green', 'blue']

Describe alternatives you've considered
Only load real STAC items, and avoid loading standard COGs. Could build the STAC items manually/via python tooling for each COG the user want to load on keplergl. The titiler way to load them could however open up possibility to load any COG almost natively, which could be great.

Additional context
Here is the sample data tested against

Example via a test-data COG sample from developmentseed/geotiff-test-data hot-oam: titiler-stac item

Note also: conveniently, instead of relying on igorDykhta/kepler-raster-server, the flow to add this COG is, within kepler demo app: Add Data -> Tileset -> Raster Tile, then Raster-Tile Server can point to a standard titiler endpoint, eg https://titiler.xyz

Details

{
  "type": "Feature",
  "stac_version": "1.1.0",
  "stac_extensions": [
    "https://stac-extensions.github.io/projection/v1.1.0/schema.json",
    "https://stac-extensions.github.io/raster/v1.1.0/schema.json",
    "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
  ],
  "id": "cog.tif",
  // geometry, bbox, properties, links": [],
  "assets": {
    "data": {
      "href": "....tif",
      "type": "image/tiff; application=geotiff",
      "raster:bands": [
        {
          "data_type": "uint8",
          "scale": 1,
          "offset": 0,
          "sampling": "area",
          "statistics": { /* ... */ },
          "histogram": { /* ... */  }
        },
        // ...
      ],
      "eo:bands": [
        {
          "name": "b1",
          "description": "red"
        },
        {
          "name": "b2",
          "description": "green"
        },
        {
          "name": "b3",
          "description": "blue"
        }
      ],
    }
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions