Fix getting tiles from a 3D tiled grid coverage using "ImageTileMatrix" class#43
Open
alexismanin wants to merge 6 commits into
Open
Fix getting tiles from a 3D tiled grid coverage using "ImageTileMatrix" class#43alexismanin wants to merge 6 commits into
alexismanin wants to merge 6 commits into
Conversation
…ying to get the resource of a 3D tile
… N dimensions. Previously, tiles from the ImageTileMatrix were assuming that its tiles were set in a 2D space. However, an ImageTileMatrix can be a 2D slice in higher dimension space (for example, CRS:84 + single elevation coordinate). In such cases, the code that was relying on tile coordinates broke.
…g multidimensional extents Previously, the code was simply ignoring extra dimensions to only focus on coverage X and Y dimensions. This causes a serious problem when a user tries to navigate in other dimensions, because the ImageTileMatrix was not able to take proper action to handle it. This change is as conservative as possible regarding previous caching behavior. We still check if a user request lies in the boundary of the previous user request, to return an already cached image if possible. The main differences are: 1. We check all dimensions of user extent: If user requests tiles in a different additional cell/extent, we reprocess a fresh image 2. We try to split input multidimensional requests into separate 2D slices, to remain on a "per image" loading strategy.
…nated tile, and only this tile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I stumbled upon a bug when trying to use Apache SIS TileMatrixSet API on a Cloud Optimized Geotiff.
The data file was using a 3D CRS (a single temporal slice on EPSG:3857+Time reference system).
Getting tiles failed with an exception, because the underlying engine was ignoring extra dimensions when selecting tiles.
This PR adds a few unit tests that reproduce the problem, and provide a fix that makes "ImageTileMatrix" class able to provide tiles even when using 3D+ CRSs.
Note that the fix tries to be conservative to the previous behavior, and preserve ImageTileMatrix image caching strategy as far as possible.
This PR also adds a slight restriction on ReshapedImage, to prevent it to serve tiles from source image outside of its reshaped boundaries. The restriction is a side-effect of a fix required on ReshapedImage to fix ImageTileMatrix.