-
Notifications
You must be signed in to change notification settings - Fork 10
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
Multiscales zoom level vs decimation #30
Comments
Thanks for the thoughts @thomas-maschler - I want to point to work being done by Carbon Plan: |
Hey @thomas-maschler and @briannapagan - thanks for the ping and sorry for my slow response! I wrote up https://ndpyramid.readthedocs.io/en/latest/schema.html for some information about the current state of multiscales in ndpyramid and @thomas-maschler on your point about the decimation approach being most common for COGs - we currently exclusively use the webmap zoom levels approach to pyramids under the following assumptions:
Do you mind sharing if there's anything that I'm missing here that would motivate supporting both the web-optimized and decimation structure in Zarr? The main counter argument that I'm aware of is having the pyramids be as similar to the raw data as possible, though it's not clear to me whether that's worth the reduced rendering performance in most cases. |
FYI I just opened carbonplan/ndpyramid#92 to discuss if we should support generating custom tiling schemes and, if so, how it would be represented in the metadata, which touches a bit on this topic. Would love any thoughts you have to share! |
Thanks @maxrjones, if you plan to use the overviews for rendering webmaps your strategy makes sense. However, this is not always the case. Here are a few use cases for which the zoom level strategy does not apply: Multi-Scale Analysis: Custom projection: Scene data: In my initial comment, I mentioned the TMS Specifications, which supports top-down (zoom level) and bottom-up (decimation) profiles. The WMTS Specification uses an even more flexible approach. The identifier of the level can be any arbitrary string. The resolution is defined by the These two Specifications are well-established battle proven standards and I think it would be worth leaning on one of those concepts, to support a broad range of use cases. |
Hi there! We use a very simple spec for multi-resolution Zarrs for efficient visualisations since several years: https://github.com/dcs4cop/xcube/blob/master/docs/source/mldatasets.md Also here, higher decimations represent lower zoom levels. Basically it is a pyramid created on to of the original dataset at level zero using the original CRS. For visualisation, tailored tile matrix sets using different CRSes are created on-the-fly by the tile server (xcube). For us it is important to not create redundant datasets just for visualisation purposes. |
I'd like to get more clarity on the Multiscales section.
To my understanding, overviews for raster data - including COGs - do not necessarily have to align with standard webmap zoom levels. In fact, for most projections, a direct comparison is not even possible. Depending on the location, tiles in a local projection might fall into different zoom levels or might be wrongly oriented. Mapbox wrote a nice blog post on the various challenges showing raster tiles in non-standard projections on a webmap.
There are only two projections for which standard webmap zoom levels are commonly used. Webmercator projection (epsg:3857) and Plate Carree (epsg:4326). For the first, Zoom level 0 can be represented using a single tile. For the latter, Zoom level 0 can be represented using two tiles. Tiles for the following zoom levels can be derived by creating a quad-tree for each tile in zoom level 0.
While you can theoretically follow a similar approach for other global projections, in practice it often doesn't lend itself very well. In many cases, you would end up with parent tiles being partially outside of the projection's extent and/or some of the child tiles being fully outside, etc.
For Geotiffs and other raster formats, we usually create overviews in decimation of 2^n relative to the base resolution. Such overviews may or may not align with standard webmap zoom levels. We always use the decimation as the descriptor, not the zoom level. (Roughly speaking, higher decimations represent lower zoom levels).
The TMS Specifications summarize these two different approaches quite well in the profile section.
In its current form, the GeoZarr Specifications do not capture well these challenges and assume that overviews are always aligned with webmap zoom levels. To my opinion, this is usually the exception, not the norm.
It is also not clear to me whether it would be allowed to have overviews in a different projection than the base layer. This idea is quite tempting to me. This would allow storing data in a local projection in the base resolution and build overviews using WebMercator for easy viewing. However, varying projections could also cause trouble in cases when users would want to use existing overviews for resampling data.
I'd like to discuss how this issue can be better represented in the specification.
One solution could be to make the
level
key not mandatory and introduce a mandatory keydecimation
. Having an additional key indicating the units per pixel would also be valuable in case users choose a decimation that is not a whole number. Naturally, the path should follow the order of the decimation, not of the zoom level. IMO, when not specifying thecrs
, the projection should default to the projection of the base dataset, not pseudo plate caree.An example would look like this (red mandatory, green optional)
Please note that this suggestion would break the
path
order of the current specs.I am curious to hear other people's thoughts on this.
The text was updated successfully, but these errors were encountered: