mil_os / lee_os / gs48: `P->es = 0` without `P->e = 0` projects such that the center does not map to the origin on the default ellipsoid
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the mil_os, lee_os, and gs48 projection definitions in src/projections/mod_ster.cpp, then read the shared setup and forward/inverse routines cited in the issue. Reproduce the reported center coordinates with the default ellipsoid and with +R=. Done means the centers map to the origin and results no longer depend on +ellps, with the projection behavior and documentation consistent with the intended spherical form.
Written by the indexing model from the issue text.
Description
AI usage
- Fable 5.1 supported the creation of this ticket.
- This ticket has been (mostly) written by myself (human), and is aimed at being read by humans.
Example of problem
The table shows the deviation from expected, in meters.
Miller oblated stereographic, fixed center lon_0 = 20 E, lat_0 = 18 N
+proj=mil_os fwd (20 E, 18 N) = 0.000 -11607.296
+proj=mil_os +ellps=WGS84 fwd (20 E, 18 N) = 0.000 -11607.296
+proj=mil_os +ellps=clrk66 fwd (20 E, 18 N) = 0.000 -11736.282
+proj=mil_os +R=6378137 fwd (20 E, 18 N) = 0.000 -0.000
+proj=mil_os +a=6378137 +b=6378137 fwd (20 E, 18 N) = 0.000 -0.000
+proj=mil_os fwd (100 W, 35 S) = -19233374.228 -18150580.102
+proj=mil_os +R=6378137 fwd (100 W, 35 S) = -19110058.965 -18219883.135 (141 km apart)
+proj=mil_os fwd (10 E, 50 N) = -703233.038 3376463.037
+proj=mil_os +R=6378137 fwd (10 E, 50 N) = -700940.072 3397111.428
Lee oblated stereographic, center 165 W 10 S
+proj=lee_os fwd (165 W, 10 S) = -0.000 5267.742
+proj=lee_os +R=6378137 fwd (165 W, 10 S) = 0.000 -0.000
GS48, center 96 W 39 N
+proj=gs48 fwd (96 W, 39 N) = 0.000 -20670.771
+proj=gs48 +R=6370997 fwd (96 W, 39 N) = 0.000 -0.000
Contrasting, this is alsk and gs50, which set e and es together, showing that they map their centers to the origin:
+proj=alsk fwd (152 W, 64 N) = 0.000 -0.000
+proj=gs50 fwd (120 W, 45 N) = 0.000 0.000
Problem description
PJ_PROJECTION(mil_os), lee_os and gs48 (src/projections/mod_ster.cpp lines 145, 165, 185) set P->es = 0. to
make the projection spherical, but P->e keeps the value the ellipsoid setup gave it (=GRS80 by default). The shared
forward and inverse (mod_ster_e_forward line 33, mod_ster_e_inverse line 93) compute the conformal latitude of
every point with P->e, while mod_ster_setup (lines 116-122) sees P->es == 0 and takes the center's latitude
geodetically. The result is a hybrid: points are placed at their conformal latitude relative to a center that was not
converted. With the default ellipsoid the fixed projection center does not project to (0, 0), and the map depends on
+ellps although the projection declares itself spherical.
Expected Output
Either the spherical projection the P->es = 0. assignment intends (the center at the origin, the map independent of
+ellps, as +R= gives), or a consistent ellipsoidal form in which the center is converted too. The coefficient sets
PROJ carries for mil_os, lee_os and gs48 are single, spherical sets, whereas alsk and gs50 carry a spherical and a Clarke 1866 set and select by P->es. I think this means that the spherical reading is what the code's own data supports. The P->es = 0. implies it is what was intended.
Proposed fix
In PJ_PROJECTION(mil_os), lee_os and gs48:
P->es = 0.;
P->e = 0.;
(or call pj_calc_ellipsoid_params(P, P->a, 0.), which also refreshes P->one_es, P->rone_es and P->b). The
documentation of the three ("Available forms: Forward and inverse, spherical and ellipsoidal", +ellps defaulting to
GRS80) should then say spherical, as it does for the other fixed-sphere projections. If instead a true ellipsoidal form
is wanted, drop the P->es = 0. so mod_ster_setup converts the center as well; but the published coefficients were
fitted on the sphere.
Note: gs48 also reassigns P->a (line 186), which has a second, independent effect on the inverse; see the separate
report on the stale P->ra.
Environment Information
- PROJ version (
proj): 9.7.0 - Operation System Information: MacOS Sequoia 15.7.7
Installation method
- From C source
- Dominant language
- C++
- Stars
- 2k
- Forks
- 918
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 20
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OSGeo/PROJ
-
gs48 / alsk / gs50: `P->a` is reassigned in the projection setup but `P->ra` keeps the ellipsoid's reciprocal, so forward and inverse disagreePossibly taken @manduinca claimed this 6 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
OSGeo/PROJ#4933 · 2 comments ·
Maintainers usually reply within 1 day
-
String parser: +czech on krovak/mod_krovak sets the base geographic CRS axes to W/S, so the exported conversion negates lat/lonPossibly taken @manduinca claimed this 5 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Compound CRS with NAVD88 height (ftUS) to WGS 84-based + NAVD88 height: pipeline mixes GEOID18 and GEOID03 (~1.2 m error)Possibly taken @manduinca claimed this 7 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
OSGeo/PROJ#4895 · 3 comments ·
Maintainers usually reply within 1 day
-
DERIVEDPROJCRS with 3D Helmert deriving conversion: transform to base CRS works, but to EPSG:4326 fails with "Mismatched units"May be free again @rouault-on-strike claimed this 27 days ago, and no pull request is open. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
OSGeo/PROJ#4889 · 4 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Bug Translations
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
wesnoth/wesnoth#11728 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
rpm-software-management/dnf5#3043 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2385 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AustinKelsay/dnd-diceroll#200 ·
Maintainers usually reply within 1 day