Skip to content
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

apply_neighborhood with overlap: nodata at edges #307

Open
jdries opened this issue Jun 18, 2024 · 1 comment
Open

apply_neighborhood with overlap: nodata at edges #307

jdries opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jdries
Copy link
Contributor

jdries commented Jun 18, 2024

apply_neighborhood sets pixel_buffer in load_collection to load extra data at the edges.

However, the retiling code first performs retiling, and then buffers the tiles. The consequence being that edge tiles still get padded with nodata.

regridded.withContext(_.bufferTiles(_ => BufferSizes(overlapX,overlapX,overlapY,overlapY)).mapValues(tile=>{

The effect is also visible here in this image, which was produced with a window size of 48 and 8 pixel overlap:

Image

@jdries jdries self-assigned this Jun 18, 2024
@jdries
Copy link
Contributor Author

jdries commented Jun 18, 2024

Solutions

Option 1

Change the computation of LayoutDefinition in RegridFixed, to shift the extent by the required amount so that the origin ends at the corner of a window rather than at the corner of the full chunk.

Problem is: how do we know for sure if the extent was already buffered in the first place, to accomodate this? Also when we undo the regridding, we'll have to take this into account?

Perhaps we need to store the applied buffer in the datacube metadata somewhere?

Option 2

Already apply the buffering in load_collection. This would then be a 'push down' of apply_neighborhood parameters. This solution will not work if other complex processes are in between.
It also needs to play well with resample processes: it can only work in the case where resampling parameters are also pushed down.

@JeroenVerstraelen JeroenVerstraelen added the bug Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants