-
Notifications
You must be signed in to change notification settings - Fork 94
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
Update AreaDefinition equality to use pyproj CRS #415
Conversation
Previously this used PROJ.4 strings which produced a UserWarning from pyproj. This also includes updates to creating an area from rasterio to use a CRS directly.
Codecov Report
@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 93.86% 93.88% +0.01%
==========================================
Files 65 65
Lines 11125 11124 -1
==========================================
+ Hits 10443 10444 +1
+ Misses 682 680 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Pyproj has issued a warning for a long time now to tell the user to avoid using PROJ.4 strings and dictionaries as they are considered inaccurate as far as completely defining a projection (where WKT is now preferred). This PR updates one usage of this in
AreaDefinition.__eq__
so it compares the pyproj CRS objects directly instead of the PROJ.4 strings. This change does make equality a lot more strict, but probably in a good way. It now fails if your ellipsoid was defined in different ways or if axis order is different. This is very common with EPSG inputs.This PR updates a few things to improve on this in the tests. It also includes a backwards incompatible change to the rasterio utilities to bring the argument name inline with AreaDefinition and be more accurate (
projection
instead ofproj_dict
).Note: With these changes I am able to generate an ABI true_color composite in Satpy with no PROJ warnings.
git diff origin/main **/*py | flake8 --diff