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

bugfix in clip_bbox for clipping on a bbox outside of rasterdataset #860

Merged
merged 7 commits into from
Apr 11, 2024

Conversation

roeldegoede
Copy link
Contributor

@roeldegoede roeldegoede commented Mar 27, 2024

Issue addressed

Fixes #859

Explanation

Explain how you addressed the bug/feature request, what choices you made and why.

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed
  • Updated changelog.rst if needed
  • For predefined catalogs: update the catalog version in the file itself, the references in data/predefined_catalogs.yml, and the changelog in data/changelog.rst

Additional Notes (optional)

Add any additional notes or information that may be helpful.

@roeldegoede
Copy link
Contributor Author

Added tests that test for clip_bbox when bbox is left, right, below or above the extent of the data.

Somehow, this does not yet fully work for rotated grids ... (see failing test) and figure below, where bbox is plotted in red (left of data extent) but the clip_bbox function still return data ..

image

Copy link
Contributor

@savente93 savente93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this work Roel! Good that you wrote tests, however, they are still failing. Could you take a look what is going wrong?

Copy link
Contributor

@DirkEilander DirkEilander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @roeldegoede for the report, fix and tests. I've amended the fix slightly to work for all tests including some edge cases. I think this can be merged now.

Copy link
Contributor

@savente93 savente93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are green so LGTM. once you fix the merge conflict feel free to merge

@DirkEilander DirkEilander merged commit 8a446b0 into Deltares:main Apr 11, 2024
10 checks passed
@savente93 savente93 mentioned this pull request Jun 14, 2024
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

Successfully merging this pull request may close these issues.

bug in clip_bbox of raster.py
3 participants