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

Added tileLevelMin/Max and colormap details to STAC xcube:data_vars #940

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

edd3x
Copy link
Contributor

@edd3x edd3x commented Mar 5, 2024

[Description of PR]
Currently, our web visualisation development team have been using the /datasets endpoint 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.

What I have done here is to use the DatasetsContext to derive the tiling scheme and get the colormap details using derive_tiling_scheme() and get_color_mapping() in xcube/webapi/ows/stac/controllers.py so the xcube:data_vars in the STAC item JSON output will return the additional variables like tileLevelMin, tileLevelMax, colorBarName, colorBarMax and colorBarMin.

I created a new method _get_xc_data_variables and _get_xc_data_variable to return the xcube:data_vars.

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in xcube/webapi/ows/stac/controllers.py
  • Changes documented in CHANGES.md
  • GitHub CI passes
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

@forman forman requested review from pont-us and forman March 6, 2024 11:57
Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @edd3x, thanks for the PR. The extension to data variables is very useful and code looks good!
In fact, we plan to deprecate the /datasets endpoint and use only STAC. Then, I'm sure we'll need to enrich the data variable object by even more information. To be compatible with such an extension, we might put the extra information into a dedicated object, either as an object in attrs or as new own property extra or similar. We'll let you know here asap. Stay tuned and thanks!

@forman
Copy link
Member

forman commented Apr 4, 2024

Hey @edd3x, FYI, we haven't started the activity yet, but it is still on the roadmap for spring 2024.

@edd3x
Copy link
Contributor Author

edd3x commented Apr 5, 2024

Hey @edd3x, FYI, we haven't started the activity yet, but it is still on the roadmap for spring 2024.

Thanks @forman for the update, looking forward to the release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants