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

Write multi-resolution RGBA pyramids #209

Closed
5 of 7 tasks
forman opened this issue Oct 21, 2019 · 1 comment · Fixed by #266
Closed
5 of 7 tasks

Write multi-resolution RGBA pyramids #209

forman opened this issue Oct 21, 2019 · 1 comment · Fixed by #266
Assignees
Labels
CCI KE code Issue is related to code refactoring or optimisation important This is very important for the project

Comments

@forman
Copy link
Member

forman commented Oct 21, 2019

Is your feature request related to a problem? Please describe.

Missing a CLI command and API functions that allow creating RGBA image pyramids from a dataset variable in the same way as it is done in the xcube server's WMTS (for the xcube viewer).

The output shall have a format that can be published by plain web servers so that frontend developers can add image layers to JS mapping clients such as Leaflet, OpenLayers, Cesium with minimum configuration effort.

Describe the solution you'd like

What:

  • New CLI command xcube var2rgb
  • New API function new_image_pyramid(cube, var_name, time_stamp, cmap, vmin, vmax) -> ImagePyramid
  • New API function write_image_pyramid(image_pyramid, output_path) that creates/updates a directory tree {output_path}/{z}/{y}/{x}.png.

How:

  • Move package xcube/webapi/im to xcube/util/im
  • Move module xcube/webapi/mldataset to xcube/util/mldataset
  • Make xcube.util.mldataset.MultiLevelDataset compatible with xcube.util.im.tiledimage.ImagePyramid
  • Make xcube.util.mldataset.MultiLevelDataset also use xcube.util.im.tiledimage.TiledImage
  • Refactor out image generation code from xcube.webapi.controllers.tiles.get_dataset_tile() and move into
    xcube.util.im.tiledimage.new_image_pyramid() that returns an ImagePyramid from given dataset, variable,
    value ranges, and color map.
  • Add function xcube.util.im.tiledimage.write_image_pyramid() that traverses the tiles of an ImagePyramid
    and stores PNG tiles organised as (MapBox / GDAL style) image pryamid.
  • Add CLI command xcube var2rgb allowing to generate RGB(A) imagery from given cube
    and variable. It makes use of new new_image_pyramid() and write_image_pyramid().

Additional context

Required by CfS app of CCI KE project.

@forman forman added important This is very important for the project code Issue is related to code refactoring or optimisation labels Oct 21, 2019
@forman forman changed the title Write RGBA image multi-resolution pyramids Write multi-resolution RGBA pyramids Oct 21, 2019
@forman forman added the CCI KE label Oct 21, 2019
@forman forman self-assigned this Oct 21, 2019
@forman forman added the in progress The assignee is working on it label Oct 21, 2019
@forman
Copy link
Member Author

forman commented Oct 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCI KE code Issue is related to code refactoring or optimisation important This is very important for the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant