girder / large_image

Python modules to work with large multiresolution images.
http://girder.github.io/large_image/
Apache License 2.0
195 stars 43 forks source link

xarray source? #847

Open banesullivan opened 2 years ago

banesullivan commented 2 years ago

How challenging would it be to create a new source that accepts xarray Dataset objects as input?

There is some existing work in this space here: https://github.com/davidbrochart/xarray_leaflet

banesullivan commented 2 years ago

For geospatial:

rioxarray may make this not too bad: https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html

Perhaps use rioaxarray to then leverage rasterio to implement getTile()?

manthey commented 2 years ago

It should be quite easy. Do we have a sample dataset that can be used for testing and verification?

To make a new tile source, you need to populate a number of properties in the source class init method: sizeX, sizeY, tileWidth, tileHeight, levels. And then you need to add a getTile method. Everything else is optional.

abkfenris commented 2 years ago

Last week during an IOOS code-sprint (basically a hackathon), my group took a swing at image and data tiling xarray datasets among other thing.

While I didn't end up too much in the weeds of the tile implementation, though I believe that we found rioxarray was faster, but only worked on a smaller selection of datasets compared to xesmf. Limiting input to the selection of datasets that cf-xarray can parse might be useful.

Our (not fully documented) work is here: https://github.com/asascience/restful-grids

An issue on the xpublish library that might also be useful: https://github.com/xarray-contrib/xpublish/issues/92