-
Notifications
You must be signed in to change notification settings - Fork 0
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
[SKETCH] Add xarray reader support for item endpoints #2
Conversation
I think we will use the |
@vincentsarago I started taking a look at how the current /collections/{collection_id} endpoint works in this repo (titiler-stacapi) and I think it is similar to the links you shared, but the STACAPIBackend of course relies on a stac query (in To get the functionality we want in this repo - that is, a STAC API query which creates tiles using, conditionally, either the XarrayReader or rio_tiler mosaic_reader I think what is needed is the following:
I'm not sure the purpose behind reader_params or backend_params, but we will need some way, like DatasetParams, to set all the optional XarrayReader params. I would implement something like DatasetParams but for Xarray arguments. This titiler-stacapi code also has all the timing middleware - I think it would be interesting to keep this but should check that it is working. @vincentsarago let me know if ⬆️ makes sense to you. As far as the items endpoints go, I think we could leave this draft PR open for now and / or remove those item endpoints from the repo until we get them working for MS PC API. |
So, we define the the |
@vincentsarago 👍🏽 that makes sense to me, was that in response to any part of my previous comment? Because if it was
We will need additional parameters to use in xarray.open_dataset, specifically variable, but also possibly others (e.g. https://github.com/developmentseed/titiler-xarray/blob/dev/titiler/xarray/reader.py#L200-L206) |
Closing this as we are working on the collections endpoint for now. |
This PR is just the start of what I thought we might need to implement for MS PC titiler with both xarray and rasterio support. I was scoping this work to just the item endpoint and for tiling either COGs or NetCDF.
High level, what needs to happen is that when a tiles request comes in to the items endpoint
/collections/{collection_id}/items/{item_id}
, it is required to have theassets
parameter, and depending on the media type of that asset, the item will be tiled using either the XarrayReader or rasterio Reader.In this PR:
ItemId
path dependency makes a STAC API request to set the item argument to the tiles endpoint.StacReader
to determine the asset's media type (assuming just one asset for now) and then sets what asset reader to useQuestions
StacReader
which then determines the asset reader (Xarray or Rasterio) - should we instead call thisStacBackend
like titiler-cmr hasCmrBackend
?Todos in this PR can be seen in the files, but should also include handling of multiple assets.
Latter PRs - we could create issues for these if we un-fork this repo:
@vincentsarago I opened this PR so you could take a look and provide some feedback if it's on the right path. But I then realized we need the collections endpoint more than this items endpoint -- for the STAC explorer to work, it will be using STAC queries not item ids -- so I will start looking into that.