-
Notifications
You must be signed in to change notification settings - Fork 177
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
Better support for Multiscale Zarr (Groups) #1071
Comments
Ideally, we would want to provide the same user experience as with GDAL and COGs, where the reader automatically selects the appropriate (overview) scale, no? How would the proposed solution work for a client like a web map app or desktop GIS software? Would they add all scales to the map and let the mapping library handle turning layers on and off depending on the zoom level? If there is any way to take this burden off the user, I think that would be great. If it is too much automagic for generic TiTiler app, perhaps we would need a custom |
I would love that too but from what I understand the
No 🙁
Agreed
I would be nice if we don't have to know in advance if a Zarr is a GeoZarr or not! |
We can use xarray.open_datatree to open a Zarr hierarchy rather than specifying a |
Just to clarify, when we say In the original implementation, this was meant to work automagically WHEN there was a I think the multiscale parameter has gone away, is that right? Would this solution make sense? A tilejson endpoint may also make sense for some use cases where the available levels (if any) need to be known in advance 🤔 |
Scale is just related to the size of the output tile size
Yeah but this assumed that Zarr was
Yes
We could introduce back the |
That is my understanding as well, but the
I don't think is referring to the output tile size? That seems like a completely separate parameter than what we are discussing (which I would call level for now).
This was intentional: only requests for datasets with multiple levels would have the To be clear though, I'm not proposing we go with this solution, just explaining how it worked originally. |
Consider this a straw-man proposal, but I think our goal for better supporting Zarr that has a TileMatrixSet with overviews corresponding to TMS zoom resolutions, along with consolidated metadata so that one can find all this out with a single GET request (hereafter called Web-Optimized Zarr / WOZ), should be a dedicated extension (e.g., a |
@abarciauskas-bgse oh sorry I missed to see that you were talking about that 😓.
Yeah
yeah yeah 🙏
@maxrjones, I would prefer not! Ideally the user shouldn't have to know if a zarr is Optimized or not. Maybe we should re-think the XarrayReader in titiler to not work with Xarray DataArray: # now
with XarrayReader("dataset.zarr", variable="var", group="0", time=0) as da:
img = da.tile(0, 0, 0)
# maybe
with ZarrReader("dataset.zarr") as ds: # using `xarray.open_datatree`
img = ds.tile(0, 0, 0, variable="var", group="0", time=0) Not having to define the |
How does this work for titiler with GeoTIFFs/COGs? I.e., what happens if a user provides a non-cloud-optimized GeoTIFF to a cog endpoint? |
@maxrjones, GDAL automatically select the overview/raw data based on the output tile resolution. If there are no overviews nor internal chucking then it will fetch the data it needs but it will be slow because you might load the whole data in memory. Technically speaking we prefixed the endpoint with |
Thanks for the explanation, I incorrectly interpreted |
ref: https://github.com/zarr-developers/geozarr-spec/blob/main/geozarr-spec.md#multiscales
Problem
Right now to read a different
scale
we need to set thegroup=
parameter but that needs to append before opening the Zarr file, meaning we cannot dynamically select the corresponding scale based on a required Zoom Level.titiler/src/titiler/xarray/titiler/xarray/io.py
Lines 126 to 128 in 5fab604
Solution
We could create a new endpoint similar to the tilejson endpoint which return a list of
(group number, (minzoon, maxzoom))
for a specific TileMatrixSet, which then could be use by a frontend map client to construct the corect tile URL with the correct group valuecc @maxrjones @hrodmn @abarciauskas-bgse @sharkinsspatial
The text was updated successfully, but these errors were encountered: