Repository navigation
Conversation
Resolve the ellipsoid described by a PROJ string into (a, es), honouring the spherification parameters (+R_A, +R_lat_a, ...) that proj_create() followed by proj_get_ellipsoid() drops. It wraps pj_ell_set(), so the result is the ellipsoid the geod utility uses. Unrelated keys are ignored, and +R_C is evaluated at latitude 0 as in proj_create(). Closes OSGeo#4864 Assisted-by: Claude Opus 5.5
HugoFara
marked this pull request as ready for review
October 30, 2026 11:08
3 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is no public way to get the ellipsoid that a PROJ string like
+ellps=WGS84 +R_Adescribes:proj_create()+proj_get_ellipsoid()drops the+R_*keys, andpj_ell_set()is internal. pyproj needs this forGeod(pyproj4/pyproj#1157).This adds
proj_ellipsoid_from_proj_string(ctx, definition, &a, &es), a thin wrapper aroundpj_ell_set(), with the shape agreed in #4864 with @jjimenezshaw: it returns(a, es)and ignores unrelated keys.One open question:
+R_Cis evaluated at latitude 0 regardless of+lat_0, asproj_create()does today (init.cppcallspj_ellipsoid()before readingphi0, andbuiltins.gierelies on it). The docs for+R_Csay "at φ0". I kept the current behaviour and pinned it in the test, so if the docs are right, fixinginit.cppwould fix both.+R_A,+R_lat_a…) #4864docs/source/*.rstfor new API