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

Use rasterio bounds() and from_bounds() to transform Boxs #2277

Merged
merged 3 commits into from
Nov 26, 2024

Conversation

AdeelH
Copy link
Collaborator

@AdeelH AdeelH commented Nov 22, 2024

Overview

This PR refactors RasterioCRSTransformer to make use of rasterio.bounds() and rasterio.from_bounds() when transforming Boxs. Previously, this was done by applying xy() and rowcol() to the Box's corners, which sometimes required Box.normalize() to be called on the result.

Checklist

  • Added unit tests, if applicable
  • Updated documentation, if applicable
  • [ ] Added needs-backport label if the change should be back-ported to the previous release
  • PR has a name that won't get you publicly shamed for vagueness

Notes

  • This PR also constrains the required pyproj version to <= 3.7.0.
  • Some unit tests had to be adjusted to account for small differences in RasterioCRSTransformer's outputs following the changes in this PR.

Testing Instructions

See unit tests.

The handling of the network error might need to change with the next release.
remove usage of Box.normalize() since that should now be unnecessary
@AdeelH AdeelH marked this pull request as ready for review November 26, 2024 21:58
@AdeelH AdeelH merged commit df76d1f into azavea:master Nov 26, 2024
2 checks passed
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.40%. Comparing base (fb3b199) to head (76888e3).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...e/data/crs_transformer/rasterio_crs_transformer.py 88.88% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2277      +/-   ##
==========================================
+ Coverage   90.31%   90.40%   +0.08%     
==========================================
  Files         199      199              
  Lines        9925     9955      +30     
==========================================
+ Hits         8964     9000      +36     
+ Misses        961      955       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AdeelH AdeelH deleted the rio_crs_tf_box branch November 27, 2024 16:03
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.

1 participant