xcube-dev / xcube

xcube is a Python package for generating and exploiting data cubes powered by xarray, dask, and zarr.
https://xcube.readthedocs.io/
MIT License
201 stars 20 forks source link

Add TileLevelMin, TileLevelMax and colormap attributes to STAC #935

Open edd3x opened 8 months ago

edd3x commented 8 months ago

Currently, our web visualisation development team have been using the/datasetsendpoint from the xcube server API which provides tileLevelMin, tileLevelMax, colorBarName, colorBarMax and colorBarMin per data variable as part of the JSON output. We are however changing to ows.stac via the /ogc endpoint because it's faster, but the STAC JSON output does not provide the above-listed attributes.

I propose the implementation of the derive_tiling_scheme() and the get_color_mapping() in xcube/webapi/ows/stac/controllers.py so the xcube:data_vars will return the additional variables like tileLevelMin, tileLevelMax, colorBarName, colorBarMax and colorBarMin.

I have just implemented it in my local repository and worked out as we wanted.