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

resample()'s cubic and Lanczos window sizes are undocumented #1568

Closed
twest820 opened this issue Jul 20, 2024 · 1 comment
Closed

resample()'s cubic and Lanczos window sizes are undocumented #1568

twest820 opened this issue Jul 20, 2024 · 1 comment

Comments

@twest820
Copy link

I'm extracting aligned samples from several rasters with different cell sizes and then standardizing them to one cell size with resample(). Because the rasters are large (hundreds of MB to tens of GB for the virtual rasters) and the standardization is to the smallest cell size, it's necessary to window the area of interest before resampling. I had a bug where the windows weren't necessarily quite large enough, resulting in resample() occasionally producing NAs at area of interest edges.

As part of fixing this, I noticed terra's resample() documentation doesn't state window size requirements for cubic and Lanczos. I'm guessing terra indirectly calls IRasterIO() with resample()'s method argument remapped to GDALRIOResampleAlg. Is this correct? If so, the result would be cubic and cubicspline use a 4x4 window and lanczos a 6x6.

@rhijmans
Copy link
Member

This uses GDALwarp , but surely RasterIO uses the same underlying algo. I have added the window size to the docs (adding 1, as I think it should be 5x5 and 7x7). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants