fix(area): complete area definitions with explicit b parameter - #740
fix(area): complete area definitions with explicit b parameter#740Manny7717 wants to merge 1 commit into
Conversation
Some example area definitions (test fixtures and documentation) only defined the equatorial radius a. While PROJ accepts this, stricter tools such as GDAL fail when saving geotiffs for these areas. Add b (= a for spherical projections) to all incomplete definitions: test_files/areas.yaml, test_geometry/test_area.py fixtures, doc examples (dict, PROJ.4 string, YAML and areas.cfg forms), and document the requirement in the howto. Closes pytroll#200
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #740 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 89 89
Lines 13715 13715
=======================================
Hits 12849 12849
Misses 866 866
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This is a duplicate of #735. As commented there the original case I described in #200 doesn't seem to error out any more so these changes may not be necessary. Similarly pyresample has been using pyproj CRS objects so a lot of this a/b and other projection parameter resolution has been pushed to pyproj to resolve and normalize. Additionally PROJ.4 strings are relatively deprecated and should be relied on as little as possible once they are converted to a CRS object (stick with WKT definitions instead). I'm going to close this and the #200 issue for now. If one of the other maintainers or power users of pyresample wants to present a strong opinion on this matter then go for it and I will happily reconsider. As the original issue creator for #200 though I'm comfortable closing this for now. Thanks @Manny7717 for making the PR but I'm choosing to not merge this at least for now. |
What
Completes all incomplete area definitions in the repository. Several example projections (test fixtures and documentation) only define the equatorial radius
a; while PROJ accepts this and treats the ellipsoid as a sphere, stricter tools such as GDAL reject these definitions when writing geotiffs (reported in #200, encountered by Satpy users).Change
Add
b = ato every projection that only defineda:pyresample/test/test_files/areas.yaml— 13 area definitionspyresample/test/test_geometry/test_area.py— projection dicts and PROJ.4 strings used as test fixturesdocs/areas.cfg, and howto examples ingeo_def.rst,geometry_utils.rst,plot.rst,plot_cartopy_basemap.rst,plot_projections.rst,spherical_geometry.rst(dict, PROJ.4 string, YAML and.cfgforms)geo_def.rstdocumenting that bothaandbshould always be definedWhy it's safe
a-only anda+b(withb = a) definitions normalize to the identical CRS in pyproj (+R=6371228sphere form,CRS.equals()→True), so no coordinate behavior changes — this only removes the GDAL incompatibility.Tests
python -m pytest pyresample/test/test_area_config.py pyresample/test/test_geometry/test_area.py→ 221 passed (same as before the change).. doctest::blocks in the edited howtos still pass unchanged (verified expected outputs are byte-identical)yaml.safe_loadruff checkclean on the modified test file